Skip to main content
POST
/
v1
/
tool-result
Tool Result
curl --request POST \
  --url https://api.astralform.ai/v1/tool-result \
  --header 'Content-Type: application/json' \
  --data '
{
  "conversation_id": "<string>",
  "tool_call_id": "<string>",
  "result": "<string>"
}
'
event: content_block_delta
data: {"type":"content_block_delta","delta":{"type":"text_delta","text":"Based on your location..."}}

event: message_stop
data: {"type":"message_stop"}

Documentation Index

Fetch the complete documentation index at: https://astralform.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

Overview

When the AI requests a client-side tool (via a tool_use event), your app executes the tool locally and submits the result using this endpoint. The AI then continues processing with the tool’s output.

Request Body

conversation_id
string
required
The conversation ID where the tool was requested
tool_call_id
string
required
The tool call ID from the tool_use event
result
string
required
The result of the tool execution (string or JSON)

Response

Returns a new SSE stream continuing the conversation.
event: content_block_delta
data: {"type":"content_block_delta","delta":{"type":"text_delta","text":"Based on your location..."}}

event: message_stop
data: {"type":"message_stop"}

Example

curl -N -X POST https://api.astralform.ai/v1/tool-result \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "conversation_id": "conv_abc123",
    "tool_call_id": "tool_xyz789",
    "result": "Calendar events for today:\n- 9:00 AM: Team standup"
  }'

Error Handling

If tool execution fails, submit an error result:
{
  "conversation_id": "conv_abc123",
  "tool_call_id": "tool_xyz789",
  "result": "Error: Calendar access was denied by the user"
}
The AI will acknowledge the error and continue appropriately.