Skip to main content
POST
/
v1
/
mcp
/
tool
/
execute
Execute an MCP tool
curl --request POST \
  --url http://localhost:8080/v1/mcp/tool/execute \
  --header 'Content-Type: application/json' \
  --data '{
  "type": "function",
  "id": "<string>",
  "function": {
    "name": "<string>",
    "arguments": "<string>"
  }
}'
{
  "role": "user",
  "content": "Hello, how are you?",
  "tool_call_id": "<string>",
  "tool_calls": [
    {
      "id": "tool_123",
      "type": "function",
      "function": {
        "name": "get_weather",
        "arguments": "{\"location\": \"San Francisco, CA\"}"
      }
    }
  ],
  "refusal": "<string>",
  "annotations": [
    {
      "type": "<string>",
      "url_citation": {
        "start_index": 123,
        "end_index": 123,
        "title": "<string>",
        "url": "<string>",
        "sources": "<any>",
        "type": "<string>"
      }
    }
  ],
  "thought": "<string>"
}

Body

application/json
function
object
required
type
string
Example:

"function"

id
string

Response

Tool execution result

role
enum<string>
required

Role of the message sender

Available options:
user,
assistant,
system,
tool
Example:

"user"

content

Message content - can be simple text or structured content with text and images Simple text content

Example:

"Hello, how are you?"

tool_call_id
string

ID of the tool call (for tool messages)

tool_calls
object[]

Tool calls made by assistant

refusal
string

Refusal message from assistant

annotations
object[]

Message annotations

thought
string

Assistant's internal thought process