const output = await client.call("search_docs", { query: "retry policy" });output = client.call("search_docs", {"query": "retry policy"})namestringrequiredThe tool, as the server names it — not the prefixed name.
argsobject{}Its arguments.
signalAbortSignalCancels it.
timeoutinteger60 000Milliseconds.
schemaobjectThe tool's recorded schema, so header annotations can be honoured.
Pass the schema when the tool uses headers
A server that expects it in a header then sees a mismatch between the header and the body, and refuses with a protocol-level error. api.mcp.call() passes the recorded schema for exactly this reason.
Long output is clipped, and says so
At 60 000 characters, with a line stating how many were dropped. A tool returning a whole dataset would otherwise fill a model's context in one call.
Errors
| Code | Status | When |
|---|---|---|
| mcp_error | 502 | The server returned a protocol error. Its message is carried. |
| mcp_http_error | 502 | A refusal at the HTTP level. |
| mcp_bad_response | 502 | The answer was not a readable protocol message. |
| mcp_timeout | 504 | Past the timeout. |
| mcp_unauthorized | 401 | The token was refused. |
In an agent, this is wrapped
The engine turns each allowed tool into an ordinary tool with a category, so a call goes through the permission callback and counts in the run. Calling the client directly skips all of that — which is correct when the decision is yours.