Fix MCP call_tool ignoring per-server tool_timeout#1175
Open
PaoloC68 wants to merge 1 commit intoagent0ai:developmentfrom
Open
Fix MCP call_tool ignoring per-server tool_timeout#1175PaoloC68 wants to merge 1 commit intoagent0ai:developmentfrom
PaoloC68 wants to merge 1 commit intoagent0ai:developmentfrom
Conversation
The call_tool method always used the global mcp_client_tool_timeout setting, ignoring the per-server tool_timeout override. This caused tools with long execution times (e.g. Perplexity deep research) to timeout prematurely at the global default (120s) even when the server config specified a higher timeout. Apply the same resolution pattern already used for SSE/HTTP transport connections (line 1110): prefer per-server tool_timeout, fall back to global setting.
de59f95 to
2708025
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
call_toolinMCPClientBasealways used the globalmcp_client_tool_timeoutsetting, ignoring the per-servertool_timeoutoverridetool_timeout, fall back to global settingThe Bug
The per-server
tool_timeoutwas already being used for the transport-level SSE read timeout, but not for the actual MCP protocolcall_tooloperation. This one-line fix makes them consistent.Impact
Any MCP server with a custom
tool_timeoutin its config was silently having that value ignored during tool execution. Only the transport connection respected it.Testing
tool_timeout: 1200for 20-minute research queries)tool_timeout(falls back to global as before)