-
Notifications
You must be signed in to change notification settings - Fork 2k
Description
Please fix the issue where duplicate tool names in multiple MCP tools cause the agent list to hang
Problem Description:
When two MCP servers have tools with the same internal tool name, running agent list MCP: list tools from server xxxx will hang, and after the tool list is (supposedly) returned, the agent cannot work properly. During troubleshooting, issues such as network, protocol, registration, or async problems were suspected, but the real cause was that one of the MCP tools had a conflicting tool name, making it impossible for the agent SDK to distinguish between tools from different servers.
Steps to Reproduce:
- Deploy two MCP servers, each containing a tool with the same name.
- Run the agent SDK as usual until executing agent list MCP: list tools from server xxxx.
- Observe that the program hangs and does not return as expected.
Expected Behavior:
Even if different MCP servers have tools with the same name, all tools should be correctly distinguished and listed.
Suggested Fix:
It is recommended to prefix the tool name with the MCP server name (e.g., serverA:run, serverB:run) to ensure global uniqueness and avoid conflicts.
Troubleshooting Process:
- Checked network, registration, protocol, and agent SDK code, but found no issues.
- Ultimately identified that the problem was caused by tool name conflicts, which led to abnormal behavior in the agent SDK.
Note for Developers:
If you encounter the agent list hanging, please first check whether the tool names are unique!