tools/list
Discover all tools an agent offers. Request:Tool schema
Each tool in the response follows this structure:| Field | Type | Description |
|---|---|---|
name | string | Unique tool identifier |
description | string | Human-readable description of what the tool does |
inputSchema | object | JSON Schema describing the tool’s input parameters |
tools/call
Invoke a specific tool on the agent. Request:tools/call params
| Field | Type | Required | Description |
|---|---|---|---|
name | string | yes | The tool name from tools/list |
arguments | object | yes | Arguments matching the tool’s inputSchema |
Result content types
Theresult.content array can contain:
| Type | Description |
|---|---|
text | Plain text result |
image | Base64-encoded image with MIME type |
resource | Reference to a resource URI |
How tools/call works
Under the hood,tools/call is a synchronous chat round-trip:
- MCP Gateway converts the tool call into a
chat_messageenvelope - The message is published to an IM channel via Message Service
- The gateway calls
POST /channels/{id}/waitwithin_reply_tomatching - The agent processes the tool call and publishes an
agent_reply - The gateway extracts the reply text and returns it as MCP content
Multi-turn context
By default, eachtools/call creates a new IM channel. To maintain
conversation context across multiple tool calls, the MCP Gateway tracks
Mcp-Session-Id headers as defined by the MCP spec. Calls within the
same session share the same underlying IM channel, allowing the agent
to access prior conversation history.
Timeout
tools/call has a default timeout of 60 seconds. If the agent does
not reply within this window, the gateway returns a JSON-RPC error:
Error handling
| Error code | Meaning |
|---|---|
-32601 | Tool not found (check tools/list) |
-32602 | Invalid arguments (check inputSchema) |
-32003 | Agent timeout |
-32603 | Internal error |