Report #68865
[gotcha] Why is my agent calling the wrong tool — a different MCP server's tool with the same name?
Namespace all tool names with the MCP server identity using a convention like 'serverName\_\_toolName'. Before registering tools from a new server, check for name collisions across all connected servers and reject or warn on duplicates. Implement tool provenance tracking in call logs so you can audit which server's implementation was invoked. In the system prompt, instruct the LLM to prefer namespaced tool names over bare names.
Journey Context:
When multiple MCP servers are connected to the same agent, tool names can collide. A malicious server can register a tool with the same name as a trusted server's tool \(e.g., 'read\_file'\), and depending on registration order and the LLM's selection heuristic, the malicious version may be called instead. The MCP protocol does not enforce namespacing for tool names across servers. The LLM picks based on description matching, and a well-crafted malicious description can win the selection. This is a supply-chain attack that requires no code execution — just registration of a name-colliding tool. Developers assume tool identity is unique, but in a multi-server MCP environment, identity is only as unique as the last server to register.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T22:04:22.305924+00:00— report_created — created