diff --git a/core/tools/callTool.ts b/core/tools/callTool.ts index c1d2039728c..faec8a94b8c 100644 --- a/core/tools/callTool.ts +++ b/core/tools/callTool.ts @@ -1,3 +1,4 @@ +import { CallToolResultSchema } from "@modelcontextprotocol/sdk/types.js"; import { ContextItem, Tool, ToolCall, ToolExtras } from ".."; import { MCPManagerSingleton } from "../context/mcp/MCPManagerSingleton"; import { canParseUrl } from "../util/url"; @@ -87,10 +88,14 @@ async function callToolFromUri( if (!client) { throw new Error("MCP connection not found"); } - const response = await client.client.callTool({ - name: toolName, - arguments: args, - }); + const response = await client.client.callTool( + { + name: toolName, + arguments: args, + }, + CallToolResultSchema, + { timeout: client.options.timeout }, + ); if (response.isError === true) { throw new Error(JSON.stringify(response.content));