Function: mcpToolToTool()
function mcpToolToTool(
mcpTool,
client,
options?): Tool;
Defined in: mcp/tools.ts:100
Convert a single MCP tool to our Tool format
Parameters
| Parameter | Type | Description |
|---|---|---|
mcpTool | MCPToolDefinition | The MCP tool definition from the server |
client | MCPClient | The MCP client to use for calling the tool |
options | MCPToolConversionOptions | Conversion options |
Returns
A Tool that can be registered with the agent
Example
const tools = await client.listTools();
const convertedTools = tools.map(t => mcpToolToTool(t, client));
agent.toolRegistry.registerTools(convertedTools);