Elffuss BraidHub

kikocis/continue public

feat: add mcp request timeout when calling tool
Changesetaa7e0d46a03646588162c895da14b33109e6f37a4c915f05eb49fae13dafef7e
Authoruinstinct <61635505+uinstinct@users.noreply.github.com> · 2025-09-05 19:11 +05:30
Committeruinstinct <61635505+uinstinct@users.noreply.github.com> · 2025-09-05 19:11 +05:30
Parents80ec3503f561

Browse the files at this changeset

1 file changed

modified core/tools/callTool.ts +9 −4
@@ -1,3 +1,4 @@
1+import { CallToolResultSchema } from "@modelcontextprotocol/sdk/types.js";
12 import { ContextItem, Tool, ToolCall, ToolExtras } from "..";
23 import { MCPManagerSingleton } from "../context/mcp/MCPManagerSingleton";
34 import { canParseUrl } from "../util/url";
@@ -87,10 +88,14 @@
8788 if (!client) {
8889 throw new Error("MCP connection not found");
8990 }
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+ );
9499
95100 if (response.isError === true) {
96101 throw new Error(JSON.stringify(response.content));