What is Tool Name Collision?

2 min read Updated

Tool name collision occurs when multiple MCP servers expose tools with the same name, creating ambiguity about which tool the AI agent actually invokes. This can happen accidentally or be exploited deliberately.

WHY IT MATTERS

MCP clients typically aggregate tools from all connected servers into a single tool list presented to the AI agent. If two servers both expose a tool called send_email, the agent has no reliable way to distinguish between them. Which one gets called may depend on connection order, server response time, or undefined client behaviour.

In benign cases, this is a configuration mistake — two servers happen to use the same tool name. But the collision can be weaponised. An attacker who controls one MCP server can deliberately expose tools with names matching a trusted server's tools, creating a race condition where the malicious tool may be invoked instead of the legitimate one.

The problem is compounded by the flat namespace of MCP tool names. Unlike programming languages with package namespaces, MCP tools are identified by simple strings. There is no built-in mechanism for disambiguation, and most MCP clients do not warn about collisions.

For organisations running multiple MCP servers — databases, APIs, internal tools — collisions become increasingly likely as the number of connected servers grows. Without explicit routing policies, tool calls become unpredictable.

HOW POLICYLAYER USES THIS

Intercept resolves tool name collisions through YAML policies that bind tool names to specific server identifiers. A policy can specify that send_email must only route to the verified email server, blocking any other server's tool with the same name. This deterministic routing eliminates the ambiguity that makes collisions exploitable, and the fail-closed design ensures that unresolved collisions result in a blocked call rather than an unpredictable one.

FREQUENTLY ASKED QUESTIONS

How common are tool name collisions in practice?
Increasingly common as organisations connect more MCP servers. Generic tool names like 'search', 'send_message', or 'create_file' are frequently reused across servers without coordination.
Does MCP have built-in namespace support?
The MCP specification does not enforce namespacing for tool names. Some clients prefix tool names with the server name, but this is not standardised and varies by implementation.
Can collisions cause data leaks?
Yes. If an agent sends sensitive parameters to the wrong tool due to a collision, the unintended server receives that data. This is especially dangerous with tools that accept API keys, database queries, or user data as arguments.

FURTHER READING

Enforce policies on every tool call

Intercept is the open-source MCP proxy that enforces YAML policies on AI agent tool calls. No code changes needed.

npx -y @policylayer/intercept
github.com/policylayer/intercept →
// GET IN TOUCH

Have a question or want to learn more? Send us a message.

Message sent.

We'll get back to you soon.