Skip to main content
The tools/call method executes a specific tool with the given arguments. The server validates the arguments against the tool’s input schema, calls the configured API endpoint, and returns the result.

MCP Endpoint

POST https://yoursite.com/mcp/{slug}/{server_id}
Content-Type: application/json

Request

curl -X POST \
  -H "Content-Type: application/json" \
  -H "Mcp-Session-Id: your_session_id" \
  -d '{
    "jsonrpc": "2.0",
    "id": 4,
    "method": "tools/call",
    "params": {
      "name": "get_weather",
      "arguments": {
        "city": "London"
      }
    }
  }' \
  "https://yoursite.com/mcp/my-weather-tools/a1b2c3d4e5f6a1b2"

Response

{
  "jsonrpc": "2.0",
  "id": 4,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "{\"current_condition\":[{\"temp_C\":\"12\",\"temp_F\":\"54\",\"weatherDesc\":[{\"value\":\"Partly cloudy\"}],\"humidity\":\"72\",\"windspeedKmph\":\"15\"}]}"
      }
    ]
  }
}

Request Parameters

params.name
string
required
The name of the tool to call. Must match a tool defined in the server.
params.arguments
object
Key-value pairs matching the tool’s inputSchema. Required parameters must be provided.

Response Fields

result.content
array
Array of content blocks. Each block has:
  • type — Always "text" in the current implementation
  • text — The response body from the upstream API (JSON string)
result.isError
boolean
Present and true when the tool call failed. The content array still contains the error message.

Tool Execution Pipeline

When tools/call is received:
  1. Validate — Check the tool exists and is active
  2. Resolve parameters — Map arguments to the HTTP request (path, query, body, headers)
  3. Inject auth — Add API credentials to the request
  4. Call API — Execute the HTTP request to the upstream endpoint
  5. Transform — Convert the API response into MCP content blocks
  6. Log — Record the call in the analytics database
  7. Return — Send the JSON-RPC response