trading_agent.tools.tool_search_tool
¶
The tool_search tool: describes the MCP tools that match some keywords.
MCP tools are listed in the prompt by name only. This tool returns the full description and argument schema of the ones the desk asks about, so it can call them with call_mcp_tool.
Typical usage example:
tool = ToolSearchTool(manager)
ToolSearchArguments
¶
Bases: BaseModel
The arguments of tool_search.
Attributes:
| Name | Type | Description |
|---|---|---|
query |
str
|
Keywords, a tool name, or a server name to see all of its tools. |
limit |
int
|
The most tools to describe. |
ToolSearchTool
¶
Bases: Tool
Finds MCP tools and returns how to call them.
Creates the tool.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
manager
|
McpClientManager
|
The gateway's MCP connections. |
required |
Source code in src/trading_agent/tools/tool_search_tool.py
run
async
¶
Ranks the tools by how many keywords they contain.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
arguments
|
ToolSearchArguments
|
The query and the limit. |
required |
Returns:
| Type | Description |
|---|---|
ToolResult
|
The matching tools with their schemas, or the names of all tools when nothing matches. |