Repository navigation
fix: add hint to duplicated MCP server tool name error message - #3678
Conversation
…e errors
When multiple MCP servers expose identically-named tools, the SDK
raises a UserError. Update that error message to mention the existing
mcp_config={'include_server_in_tool_names': True} option, which
prefixes tool names with their server name to avoid collisions.
Fixes openai#464
seratch
left a comment
There was a problem hiding this comment.
Before merging, please narrow the hint to the non-prefixed path and make it actionable for both supported entry points. MCPUtil.get_all_function_tools() can be called directly, in which case changing agent.mcp_config does not affect that call; the caller must pass include_server_in_tool_names=True. Also, the current patch adds the same hint inside the branch where that option is already enabled, so that message would be contradictory if the defensive check fired.
Please update the wording and regression coverage for those paths. After that, this should be a small, mergeable usability improvement.
… points - Remove the hint from the include_server_in_tool_names=True branch, since suggesting the same option there would be contradictory. - Reword the hint in the default branch to mention both entry points: passing include_server_in_tool_names=True to MCPUtil.get_all_function_tools() and setting mcp_config on the Agent. - Add regression test ensuring the prefixed path raises a plain duplicate error without the hint. Related to openai#464
|
Thanks for the review. I've pushed the requested changes: Narrowed the hint to the non-prefixed path only. Please take another look. |
…e errors
When multiple MCP servers expose identically-named tools, the SDK raises a UserError. Update that error message to mention the existing mcp_config={'include_server_in_tool_names': True} option, which prefixes tool names with their server name to avoid collisions.
Fixes #464