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.
%%{init: {'theme': 'base', 'themeVariables': { 'primaryColor': '#8B0000', 'primaryTextColor': '#fff', 'primaryBorderColor': '#710101', 'lineColor': '#189AB4', 'secondaryColor': '#189AB4', 'tertiaryColor': '#fff' }}}%%
graph LR
agent["Agent"] -- "uses" --> tool["Tool: call_tool"]
tool -- "returns" --> result["Result"]
style tool fill:#189AB4,color:#fff
style agent fill:#8B0000,color:#fff
style result fill:#8B0000,color:#fffSignature
def call_tool(tool_name: Any, arguments: Any) -> AnyParameters
ParamField
AnyNo description available.
ParamField
AnyNo description available.
Returns
ResponseField
AnyThe result of the operation.
Uses
get_telemetryis_setwaittelemetry.track_tool_usagetime.timequeue.Queuethreading.Eventputlogging.debug
Source
View on GitHubpraisonaiagents/mcp/mcp.py at line 307