Elffuss BraidHub

kikocis/continue public

Merge pull request #7604 from uinstinct/mcp-request-timeout

feat: add mcp request timeout when calling tool
Changeset631c10de5d5cee7191c9dcdd789798b1b4f390c7b252e4580dae51b4b9ac7810
AuthorDallin Romney <dallinromney@gmail.com> · 2025-09-11 14:28 -07:00
CommitterGitHub <noreply@github.com> · 2025-09-11 14:28 -07:00
Parents54c1c444611d, 2a25cc336735

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));