Changesets · Branches · Tags · Compare
| Changeset | aa7e0d46a03646588162c895da14b33109e6f37a4c915f05eb49fae13dafef7e |
|---|---|
| Author | uinstinct <61635505+uinstinct@users.noreply.github.com> · 2025-09-05 19:11 +05:30 |
| Committer | uinstinct <61635505+uinstinct@users.noreply.github.com> · 2025-09-05 19:11 +05:30 |
| Parents | 80ec3503f561 |
1 file changed
modified core/tools/callTool.ts +9 −4
| @@ -1,3 +1,4 @@ | ||
| 1 | +import { CallToolResultSchema } from "@modelcontextprotocol/sdk/types.js"; | |
| 1 | 2 | import { ContextItem, Tool, ToolCall, ToolExtras } from ".."; |
| 2 | 3 | import { MCPManagerSingleton } from "../context/mcp/MCPManagerSingleton"; |
| 3 | 4 | import { canParseUrl } from "../util/url"; |
| @@ -87,10 +88,14 @@ | ||
| 87 | 88 | if (!client) { |
| 88 | 89 | throw new Error("MCP connection not found"); |
| 89 | 90 | } |
| 90 | - const response = await client.client.callTool({ | |
| 91 | - name: toolName, | |
| 92 | - arguments: args, | |
| 93 | - }); | |
| 91 | + const response = await client.client.callTool( | |
| 92 | + { | |
| 93 | + name: toolName, | |
| 94 | + arguments: args, | |
| 95 | + }, | |
| 96 | + CallToolResultSchema, | |
| 97 | + { timeout: client.options.timeout }, | |
| 98 | + ); | |
| 94 | 99 | |
| 95 | 100 | if (response.isError === true) { |
| 96 | 101 | throw new Error(JSON.stringify(response.content)); |