Calls a specified tool in an MCP service and passes the tool parameters.
Endpoint
POST /api/v1/mcp/servers/{mcpCode}/tools/call
Request parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| mcpCode | string | Yes | MCP code |
| Field | Type | Required | Description |
|---|---|---|---|
| tool_name | string | Yes | Tool name. Use a name returned by List tools |
| tool_params | object | No | Tool parameters. Keys and values follow the tool schema. Treated as an empty object when omitted |
{"tool_name":"tool_name"}. The request body cannot be omitted.
Response
| Field | Type | Description |
|---|---|---|
| isError | boolean / null | Whether the tool failed |
| content | array<Content> / null | Tool output |
| content[].type | string / null | Content type, such as text |
| content[].text | string / null | Text content |
Example
Errors
| HTTP status | error_code | Description |
|---|---|---|
| 400 | InvalidParameter | tool_name is missing, or tool_params is not a JSON object |
| 400 | - | The MCP service call failed. The error code is returned by the service |
When the tool itself fails, the API may return
200 with success=true and data.isError=true. Check both the HTTP status and data.isError.