Call Tool • AI Agent SDK

call_tool: Call an MCP tool and wait for the result.

call_tool

Method

</div>

This is a method of the MCPToolRunner class in the mcp module.

Call an MCP tool and wait for the result.

Diagram

uses

returns

Agent

Tool: call_tool

Result

Signature

python
def call_tool(tool_name: Any, arguments: Any) -> Any

Parameters

ParamField Any

No description available.

ParamField Any

No description available.

Returns

ResponseField Any

The result of the operation.

Uses

  • get_telemetry
  • is_set
  • wait
  • telemetry.track_tool_usage
  • time.time
  • queue.Queue
  • threading.Event
  • put
  • logging.debug

Source

View on GitHub

praisonaiagents/mcp/mcp.py at line 307


Related Documentation