Skip to content

Fix missing reserved_tool_names argument in non-prefixed tool path#3559

Open
mshsheikh wants to merge 1 commit into
openai:mainfrom
mshsheikh:patch-43
Open

Fix missing reserved_tool_names argument in non-prefixed tool path#3559
mshsheikh wants to merge 1 commit into
openai:mainfrom
mshsheikh:patch-43

Conversation

@mshsheikh
Copy link
Copy Markdown
Contributor

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.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant