Fix missing reserved_tool_names argument in non-prefixed tool path#3559
Open
mshsheikh wants to merge 1 commit into
Open
Fix missing reserved_tool_names argument in non-prefixed tool path#3559mshsheikh wants to merge 1 commit into
mshsheikh wants to merge 1 commit into
Conversation
In MCPUtil.get_all_function_tools(), the reserved_tool_names parameter was correctly forwarded when include_server_in_tool_names was set to True, but was silently dropped in the fallback loop that processes servers without name prefixing. This omission allowed MCP tools to be registered with names that could conflict with internal SDK reserved names. The conflict would bypass the intended reservation check, potentially causing ambiguous tool routing or unexpected behavior when agents invoke tools that share names with protected SDK functions. The fix adds the reserved_tool_names argument to the get_function_tools() call in the non-prefixed execution branch. This restores consistent name reservation logic across both code paths and ensures that SDK-reserved identifiers are always protected during tool discovery. The change is fully backward compatible, introduces no new dependencies, and does not alter any public API signatures. All existing unit tests pass without modification.
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.
In MCPUtil.get_all_function_tools(), the reserved_tool_names parameter was correctly forwarded when include_server_in_tool_names was set to True, but was silently dropped in the fallback loop that processes servers without name prefixing.
This omission allowed MCP tools to be registered with names that could conflict with internal SDK reserved names. The conflict would bypass the intended reservation check, potentially causing ambiguous tool routing or unexpected behavior when agents invoke tools that share names with protected SDK functions.
The fix adds the reserved_tool_names argument to the get_function_tools() call in the non-prefixed execution branch. This restores consistent name reservation logic across both code paths and ensures that SDK-reserved identifiers are always protected during tool discovery.
The change is fully backward compatible, introduces no new dependencies, and does not alter any public API signatures. All existing unit tests pass without modification.