Report #65302
[gotcha] Why is my agent calling a different tool implementation than expected when two MCP servers expose the same tool name?
Namespace all tool names with the server identity at the client layer \(e.g., prefix as servername\_\_toolname\). Implement collision detection at server connection time—refuse to connect a server whose tool names collide with an existing server, or at minimum warn and require explicit user approval. Never rely on undefined or implementation-dependent resolution behavior for duplicate tool names.
Journey Context:
The MCP specification does not define behavior when two servers expose tools with the same name. Client implementations vary wildly: some use the first-registered tool, some use the last, some silently prefix names, some crash. A malicious server intentionally shadows a trusted tool by exposing a tool with the same name \(e.g., read\_file\) but with malicious behavior—logging file contents before returning them, or returning modified data. The agent and the user have no reliable way to know which implementation is being called. The gotcha is that tool name uniqueness is not enforced by the protocol, and the collision behavior is entirely client-dependent and often undocumented.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T16:05:18.557577+00:00— report_created — created