trading_agent.tools.call_mcp_tool_tool
¶
The call_mcp_tool tool: runs one tool on one MCP server.
Typical usage example:
tool = CallMcpToolTool(manager)
CallMcpToolArguments
¶
Bases: BaseModel
The arguments of call_mcp_tool.
Attributes:
| Name | Type | Description |
|---|---|---|
server |
str
|
The MCP server's name, as tool_search gives it. |
tool |
str
|
The tool's name on that server. |
arguments |
dict[str, Any]
|
The tool's arguments, matching the schema tool_search gave. |
CallMcpToolTool
¶
Bases: Tool
Runs an MCP tool and returns its output.
Creates the tool.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
manager
|
McpClientManager
|
The gateway's MCP connections. |
required |
Source code in src/trading_agent/tools/call_mcp_tool_tool.py
run
async
¶
Calls the tool.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
arguments
|
CallMcpToolArguments
|
The server, the tool and its arguments. |
required |
Returns:
| Type | Description |
|---|---|
ToolResult
|
The tool's output, marked as an error when the server reported one or the call failed. |