ANTIGRAVITY LABJP
Articles/Integrations
Integrations/2026-07-28Advanced

Three Tools Named read_file: Catching MCP Name Collisions Before Startup

Bundle enough MCP servers and tool names collide quietly. Here is what a real 5-server, 21-tool setup measured at 43% collision, plus a Python preflight that catches them before startup and assigns deterministic aliases.

MCP19Antigravity342Agent Operations5DesignCLI4

Premium Article

I asked the agent to read an attached spec and summarize the diff.

What came back was the contents of a completely different file — a JSON sitting in my local working directory that happened to have a vaguely similar name.

The agent did not think it had made a mistake. The log showed a call to read_file, a successful response, and a summary built from that response. Nothing had failed.

It took counting my own config to understand why. There were three tools named read_file in my setup, on three different servers.

The initialization stopped failing, and that made the failure quiet

Antigravity 2.4.2 fixed a bug where duplicate tool names in a customization would cause agent initialization itself to fail. The details are in the Antigravity changelog.

As a fix, that is the right direction. A single typo in a config file taking down startup is a poor fit for unattended operation.

For me, though, the outcome ran opposite to what I expected.

Before the fix, a collision announced itself loudly at startup. Something was obviously wrong. After the fix, startup succeeds, the tool list assembles, the agent runs — and one tool quietly shadows the other.

The failure mode shifted from "stops" to "returns the wrong answer." Operationally, the second one is far worse. You notice the thing that stops. You can go days without noticing the thing that returns something plausible.

Since then, I run a collision check every time I add an MCP server.

Collisions come in three layers

Once I started counting, "names that clash" turned out to cover several genuinely different situations. Without separating them, there is no clean line between what a machine can fix and what a person has to decide.

Exact matches

read_file versus read_file — identical as strings. A machine can detect these with certainty and rename them without breaking any meaning. This is the automation target.

Semantic proximity

read_file versus get_file_contents — different names, nearly identical roles. From the agent's point of view, either choice works, which is exactly the problem.

These cannot be renamed automatically. The question shifts to design: do you actually need both? Detecting them and putting them in front of a human is where the machine's job ends.

Overlapping descriptions

Different names, different roles, but description fields that open the same way. Agents use descriptions for tool selection too, so similarity here makes selection wobble.

The third layer is not fully reachable by static inspection. The preflight below automates layer one, warns on layer two, and leaves layer three alone.

Thank you for reading this far.

Continue Reading

What follows includes implementation code, benchmarks, and practical content we hope you'll find useful. This site runs without ads — server and development costs are supported entirely by members like you. If it's been helpful, we'd be truly grateful for your support.

WHAT YOU'LL LEARN
A real 5-server, 21-tool setup where 43% of tool names collided across servers
A Python preflight that fails before startup — 28 ms across 305 tools, byte-identical output regardless of key order
Prefixing every tool inflates total name length by 76%; prefixing only collisions holds it to 35%
Secure payment via Stripe · Cancel anytime

Unlock This Article

Get full access to the rest of this article. Buy once, read anytime. This site is ad-free — your support goes directly toward keeping it running.

or
Unlock all articles with Membership →
Share

Thank You for Reading

Antigravity Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • Copy-paste ready implementation code
  • New advanced guides published daily
  • $5/mo or $10 for lifetime access
View Membership →

Related Articles

Integrations2026-06-22
Scope the MCP Tools You Hand an Agent: A Least-Privilege Allowlist Design
As you add MCP servers to Antigravity 2.0, the set of tools every agent can reach quietly grows into an all-you-can-eat buffet. An agent that only needs to read files seeing delete and deploy tools is an accident waiting to happen. This walks through a least-privilege design that scopes tools per agent role, denies at call time, and gates destructive operations behind a second step, with working Python and field notes.
Integrations2026-06-01
Fixing spawn npx ENOENT When an Antigravity MCP Server Won't Start
Your MCP server config JSON looks correct, but Antigravity logs spawn npx ENOENT and the server stays gray. This is almost always a PATH inheritance problem, not a broken server. Here is how to diagnose and fix it.
Integrations2026-03-28
Building Custom AI Agents with Antigravity and MCP — External API Integration
Learn how to build custom AI agents using Antigravity's MCP (Model Context Protocol) to integrate external REST APIs and Webhooks. This guide covers design, implementation, debugging, and production-ready patterns.
📚RECOMMENDED BOOKS
Build a Large Language Model (From Scratch)
Sebastian Raschka
LLM Dev
Prompt Engineering for LLMs
Berryman & Ziegler
Prompting
AI Engineering
Chip Huyen
AI Eng
* Contains affiliate links
See all →