Report #17797
[gotcha] Why is my agent calling the wrong tool when two MCP servers register similar names?
Namespace all tool names with the MCP server identity at registration time. Implement collision detection that rejects or warns on duplicate tool names across servers. Use fully qualified names \(server\_name.tool\_name\) in all agent prompts and tool selection logic. Never rely on the LLM to disambiguate based on description alone.
Journey Context:
The MCP specification does not enforce unique tool names across servers. Two MCP servers can register tools with identical names. When the LLM selects a tool by name, it may invoke the wrong server's implementation—especially if one description is more appealing to the LLM's reasoning. A malicious server can intentionally shadow a legitimate tool by registering the same name with a description crafted to be preferred by the LLM. The client typically exposes tools as a flat list with no server identity, so the LLM has no way to distinguish which server's 'read\_file' it's calling. This turns tool name collision into a silent redirection attack.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T06:22:42.362157+00:00— report_created — created