●CC 2.1.332 — No new Claude Code release over the weekend. 2.1.332 (11/25) is still current●ANALYTICS — A fix to search counts in the Enterprise Analytics API may raise numbers from 11/17 onward●SONNET 4.5 — Today, 11/30, is Sonnet 4.5's last day on the Claude API. Move to claude-sonnet-5-5●USAGE — Some users report weekly usage jumping right after upgrading to a higher plan●NEW — New: Does what a Project remembers carry over into your everyday chats?●BILLING — More readers are looking for what to check when a payment won't go through●CC 2.1.332 — No new Claude Code release over the weekend. 2.1.332 (11/25) is still current●ANALYTICS — A fix to search counts in the Enterprise Analytics API may raise numbers from 11/17 onward●SONNET 4.5 — Today, 11/30, is Sonnet 4.5's last day on the Claude API. Move to claude-sonnet-5-5●USAGE — Some users report weekly usage jumping right after upgrading to a higher plan●NEW — New: Does what a Project remembers carry over into your everyday chats?●BILLING — More readers are looking for what to check when a payment won't go through
Resolving Tool Name Collisions When You Bundle MCP Servers for the Claude API — and When the Agent SDK Already Does It for You
When the GitHub MCP and Linear MCP both expose create_issue, the model cannot tell them apart. This covers when the Agent SDK's automatic mcp__ prefix is enough and when your own bundling layer needs a reconciler, a TypeScript implementation with a runnable test, and a measured correction: the schemaHash I originally published missed all five schema drifts I tested it against.
The day I plugged the GitHub MCP and the Linear MCP into an agent where my own MCP client gathered the tools and handed them straight to the Messages API, Sonnet 4.6 received a user instruction to "open a ticket on Linear" and confidently created a GitHub issue instead. Both servers exposed a tool named create_issue, and the GitHub schema had silently overwritten the Linear one when the second server registered. I only found the cause after dumping the exact tools array my bundling layer was about to send.
Back when I wired REST APIs together by hand, the endpoint URL settled the routing question for me. MCP removes that handle. All the model gets is a tool name and a description, and overlapping verbs across servers turn out to be far more common than they were in the pre-MCP era.
What follows is the namespace design and the TypeScript reconciler I now use. It also corrects something: the schemaHash I originally published here was broken, and I only noticed months later. The correction comes with measurements.
First, a correction: the Agent SDK already namespaces MCP tools
Rereading the official docs for this revision, I owe you a correction up front. When you register servers through the Claude Agent SDK's mcpServers option, MCP tools reach the model as mcp__<server-name>__<tool-name> (checked against the Agent SDK page "Connect to external tools with MCP", November 2026). A list_issues tool on a server registered as github becomes mcp__github__list_issues, and dots or spaces in the server name are replaced with _. If the SDK owns the server connections, cross-server name collisions mostly can't happen.
My incident happened somewhere else: in a bundling layer where I ran my own MCP client and pushed the list_tools results directly into the tools array of the Messages API via @anthropic-ai/sdk. The original title said "Agent SDK", but that second setup is where a reconciler actually earns its place. I'm sorry for blurring the two.
Setup
Name the model sees
Cross-server collisions
Reconciler in this article
Servers registered in the Agent SDK's mcpServers
mcp__github__create_issue (added by the SDK)
Unlikely
Not needed. Use the full names in allowedTools
Your own MCP client + Messages API tools
Whatever the MCP server returned
Yes
Needed
Your own bundle mixing MCP tools with tools you define
Your names and MCP names in one array
Yes, including with your own tools
Needed
The deciding question is simple: does your code assemble the tools array right before it goes to the API? If it does, naming is your job. If the SDK does it, your attention is better spent writing the full mcp__ names correctly in allowedTools and permission rules.
Everything below assumes the do-it-yourself setup.
How tool name collisions actually happen
In a do-it-yourself bundle, everything up to the tools array of the Messages API is your responsibility. Each tools[].name must match ^[a-zA-Z0-9_-]{1,128}$ (official "Define tools" page, checked November 2026), so only letters, digits, underscores, and hyphens are allowed. What the API does if you send the same name twice is not documented, and I haven't verified it. In my layer, the step that folded per-server lists into a Map kept the last entry, so the earlier server's tool vanished silently.
From the model's perspective, a tool is a triple of name, description, and input_schema. If two tools with the same name get collapsed before the request leaves your process, the model never sees the duplicate. If the descriptions differ, the model is choosing based on whichever description survived the merge. That mismatch is exactly what produced the GitHub-vs-Linear mistake above.
The official "Troubleshooting tool use" page lists tool name collisions and overly generic schemas as the first suspects when Claude never calls your tool. Counting duplicates in your list looks like a detour, and it is usually the shortest path.
Typical collision-prone verbs include:
Verb
Likely MCP servers
create_issue
GitHub MCP / Linear MCP / Jira MCP
search
Notion MCP / Slack MCP / Web Search MCP
upload
S3 MCP / Cloudflare R2 MCP / Stripe Files MCP
send_message
Slack MCP / Discord MCP / SendGrid MCP
In my own setup, having three or more of these servers alive in a single agent session is the default rather than the exception. A workflow that pulls AdMob revenue numbers into Slack, opens a fix PR on GitHub, and closes the related Linear ticket walks straight into this minefield.
✦
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
✦The Agent SDK's mcpServers names tools mcp__<server>__<tool> for you, while dotted names that the MCP spec allows still fail the Messages API — a table for deciding which setup actually needs a reconciler
✦Observed misfire patterns when GitHub MCP and Linear MCP both ship create_issue, and whether the model relies more on name or description
✦A TypeScript Reconciler that prefixes only colliding tool names with double underscores and returns a bidirectional alias map
✦A measured correction: the schemaHash originally published here misused the JSON.stringify replacer and reported all five tested schema drifts as identical, plus a recursive canonicalization that fixes it
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.
There are several ways to resolve collisions. After running a few in production I kept the "prefix with server identifier" approach. Here is how the three candidates compare.
The first candidate is dot notation. Names like github.create_issue read well to humans, but the Anthropic Messages API rejects . in name and you have to escape or substitute it. That forces you to maintain a bidirectional mapping back to the original name on every dispatch.
There is a second problem. The MCP specification (2025-11-25) allows dots in tool names and even gives admin.tools.list as a valid example. The moment an upstream server returns a dotted name, it won't pass the Messages API whether or not you add a prefix. The v2 reconciler later in this article handles that.
The second is slash notation, which runs into the same character restriction and the same escape cost.
The third is double underscore separation: github__create_issue, linear__create_issue. It uses only API-legal characters and the model parses it as "the GitHub side's create_issue" without prompting. I ran the same prompt 50 times each across Sonnet 4.6 and Haiku 4.5 with temperature: 0.0, comparing strategies. Double underscore had the lowest misfire rate and beat a 2-character prefix like gh_ by about 7 points. Short prefixes also get confused with other meanings ("gh" vs "ghp"), so I do not recommend them. The official "Define tools" guidance points the same way: when tools span multiple services, prefix them with the service, as in github_list_prs.
One caveat on the numbers in this and later sections: I measured them in May 2026 on Sonnet 4.6 and Haiku 4.5. I haven't rerun them on current models, so read them as direction rather than as figures to quote, and measure your own setup.
I also keep the following rules around prefixing:
Prefixes are lowercase ASCII, between 3 and 10 characters
Original tool names stay untouched; the prefix is additive
Prefixes are applied only when there is an actual collision; never blanket-prefix everything
Rule 3 matters. Renaming every tool unconditionally hides the "idiomatic" names the model already knows (web_search, for instance) and degrades selection accuracy. Limiting prefixes to the servers that actually collide is the most model-friendly setting.
It is worth saying a word about the benchmark setup. Fifty samples is just enough to see the differences, but only if you pin the temperature to zero and replay the exact same system prompt and user message. I also kept the working set close to production, with four AdMob-related MCP servers, two GitHub-side servers, and one Slack server in the bundle — about 60 tools in total. Toy benchmarks with five tools always look rosier than reality.
Implementing a Reconciler in TypeScript
The reconciler takes server tool bundles, detects collisions, renames them, and returns a bidirectional alias map.
// reconciler.tsimport type { Tool } from "@anthropic-ai/sdk/resources/messages.mjs";export interface ServerToolBundle { serverId: string; // "github" | "linear" | ... tools: Tool[];}export interface ReconciledTools { tools: Tool[]; forward: Map<string, { serverId: string; original: string }>; reverse: Map<string, string>;}const PREFIX_SEP = "__";const NAME_RE = /^[a-zA-Z0-9_-]{1,128}$/; // Messages API tools[].nameexport function reconcile(bundles: ServerToolBundle[]): ReconciledTools { const seen = new Map<string, string[]>(); for (const b of bundles) { for (const t of b.tools) { const list = seen.get(t.name) ?? []; list.push(b.serverId); seen.set(t.name, list); } } const conflicted = new Set( [...seen.entries()].filter(([, ids]) => ids.length > 1).map(([n]) => n), ); const tools: Tool[] = []; const forward = new Map<string, { serverId: string; original: string }>(); const reverse = new Map<string, string>(); for (const b of bundles) { for (const t of b.tools) { const needsPrefix = conflicted.has(t.name); const renamed = needsPrefix ? `${b.serverId}${PREFIX_SEP}${t.name}` : t.name; if (!NAME_RE.test(renamed)) { throw new Error(`rename produced invalid tool name: ${renamed}`); } tools.push({ ...t, name: renamed }); forward.set(renamed, { serverId: b.serverId, original: t.name }); reverse.set(`${b.serverId}:${t.name}`, renamed); } } return { tools, forward, reverse };}
Three things to flag in the code. Only colliding tools get prefixed. The forward and reverse maps let you resolve github__create_issue back to "GitHub server, original name create_issue" in O(1). And the regex check throws at startup if any rename produces a name that the Messages API would reject.
The dispatcher side that runs after the model returns a tool_use block looks like this.
// dispatcher.tsimport type { ToolUseBlock } from "@anthropic-ai/sdk/resources/messages.mjs";import { reconcile, type ServerToolBundle } from "./reconciler.js";export class MCPDispatcher { private forward: Map<string, { serverId: string; original: string }>; constructor(private servers: Map<string, MCPClient>, bundles: ServerToolBundle[]) { const r = reconcile(bundles); this.forward = r.forward; } async dispatch(block: ToolUseBlock): Promise<unknown> { const meta = this.forward.get(block.name); if (!meta) { return { isError: true, content: `unknown tool: ${block.name}. available: ${[...this.forward.keys()].join(", ")}` }; } const server = this.servers.get(meta.serverId); if (!server) { return { isError: true, content: `server ${meta.serverId} not registered` }; } return server.callTool(meta.original, block.input as Record<string, unknown>); }}
One word on error handling. Throwing on unknown tool will tear down your agent loop. I made that mistake in the first revision and lost a scheduled task slot to it. The current version returns an error tool_result to the model with the list of available tools, and Sonnet 4.6 almost always corrects itself on the next turn. The wording matters — including "these tools exist: github__create_issue, linear__create_issue, ..." gives the model a runway to land on the correct name.
Normalizing descriptions with provenance tags
Renaming alone is not enough. In my measurements, when two tools share an identical description after prefixing (both literally say "Create a new issue"), the model still treats the prefix as a weak signal and picks one consistently regardless of intent. To strengthen the signal I tag descriptions by origin.
Simple, but effective. The misfire rate in my setup dropped from 38% to 6% just by adding a bracketed tag. Square brackets matter — the model reads them as an auxiliary label rather than part of the prose. For tools with long descriptions, I keep a newline after the tag so the body stays readable.
I also learned that beefier descriptions help when names collide. [GitHub] Create a new issue is too terse; [GitHub] Create a new issue in a repository. Use this for code-related bug reports, feature requests, and pull-request discussions on the GitHub side. cuts misfires by an additional 3 points. Counter-intuitive perhaps — I usually trim descriptions — but for colliding names a thicker description pays for itself.
Rebuilding when MCP servers come and go
Real Agent SDK apps see servers come and go. The user connects Slack, disconnects Discord, swaps in a new Notion workspace. Every time the tool list changes, the Anthropic prompt cache invalidates the corresponding breakpoint and the cost picture shifts. On one AdMob automation that bundled four MCP servers, I lost a meaningful slice of my monthly cache benefit before I noticed the transition was invalidating breakpoints on every reconnect.
This behavior is documented. The prompt cache builds in the order tools → system → messages, and modifying tool definitions (names, descriptions, parameters) invalidates the entire cache (see the invalidation table on the "Prompt caching" page, checked November 2026). I wrote up a registry that swaps tools mid-conversation without losing the cache in Swapping Tools Mid-Conversation Without Losing Your Prompt Cache.
The fix is to wrap server registration in an MCPManager that owns the rebuild.
Subscribe to onChange and you can re-plan your cache breakpoints, or stage the new tool list to take effect from the next turn of an in-flight agent session. The non-negotiable rule is to never swap the tool list mid-turn. If the model picked github__create_issue in the previous turn and the name has disappeared in the next, the API returns a 400 and the loop spins on retries. Switch at turn boundaries only.
The protocol also tells you when to rebuild. Under the MCP specification (2025-11-25), a server that declares listChanged for tools during initialization sends notifications/tools/list_changed whenever its list changes. When that arrives, I call list_tools again and feed the result to register, but the actual swap waits for the start of the next turn. Swapping the moment the notification lands is how you get the 400 described above.
Three production failure modes
After running this in production for a while, I want to share three specific failures.
Stale alias. GitHub MCP renamed create_issue to issues_create in an update. The reconciler picked up the new name fine, but the prompt cache still held the old system prompt with the old tool list. The model called the no-longer-existing github__create_issue, the API returned 400, and the agent retried itself into a rate limit. Fix: include a hash of the reconciler output in the cache key, and rotate breakpoints explicitly when the hash changes.
Description drift. Two tools sharing a name can have their descriptions evolve independently on each upstream side. Even after tagging by provenance, the prose underneath drifts and the model's preference flips one day for no obvious local reason. I now dump the forward map's descriptions weekly for eyeball review.
Schema collision. Two tools with the same name can have different input_schema (GitHub create_issue requires repo, Linear requires team_id). If your reconciler merges by name and ignores the schema, the model picks the wrong server's schema and the call fails on the other side. Prefixing colliding names already prevents this, but I added a safety: hash the input_schema and force a prefix whenever two same-named tools have different schema hashes, even if you would not otherwise consider them collided.
function schemaHash(t: Tool): string { return JSON.stringify(t.input_schema, Object.keys(t.input_schema).sort());}
Two smaller things worth noting alongside the big three. The first-turn misfire rate is consistently higher than later turns; I add one sentence to the system prompt ("Use the full tool name as written; github__create_issue and linear__create_issue are distinct.") and that gap closes. The other is that description length nudges the model's choice noticeably more than I expected — when names collide, expand the description rather than trim it.
The safety net was never firing: rebuilding schemaHash under measurement
That schemaHash was supposed to be the safety net — force a prefix whenever two servers share a name but disagree on the schema. Re-reading it months later, I stopped. The second argument to JSON.stringify is not a comparator. It is a replacer, and when you hand it an array it behaves as a key allowlist.
Here is the article's own code, run unmodified in a Linux sandbox on Node v22.22.3:
properties came back empty. The replacer array applies at every level of nesting, so repo and title — keys that live one level down and are not in the top-level key list — get dropped wholesale. Array elements bypass the replacer entirely, which is why required survived. The result is the worst kind of breakage: the body of the schema disappears and a plausible-looking hash still comes back.
So I measured how much it misses. Starting from a create_issue schema with repo, title, and labels, I applied five drifts of the kind an upstream server actually ships, and checked whether each implementation could tell the schemas apart.
Upstream change
Article's implementation
Corrected
labels type changes string → array
reports identical
detects
optional assignee property added
reports identical
detects
enum constraint added to labels
reports identical
detects
property renamed repo → repository
reports identical
detects
repo promoted from string to nested object
reports identical
detects
Five out of five, the published implementation answered "same schema." Nothing outside required was ever visible to it, and upstream servers rarely change their required fields when they revise a schema. The safety net was silent precisely for the drift class most likely to occur.
The corrected version canonicalizes key order recursively, then digests once:
// schema-hash.tsimport { createHash } from "node:crypto";function canonicalize(v: unknown): unknown { if (Array.isArray(v)) return v.map(canonicalize); if (v && typeof v === "object") { const out: Record<string, unknown> = {}; for (const k of Object.keys(v as object).sort()) { out[k] = canonicalize((v as Record<string, unknown>)[k]); } return out; } return v;}export function schemaHash(t: Tool): string { const canonical = JSON.stringify(canonicalize(t.input_schema)); return createHash("sha256").update(canonical).digest("hex").slice(0, 16);}
Run against the same five drifts, every pair separates. The GitHub and Linear create_issue schemas from the opening of this article land on d70c028aa9e9e8da and 49816f1ac82369fd. Schemas that differ only in key order still collapse to one hash, which is the property you want — a safety net that fires on cosmetic reordering is worse than none. That was the one thing the broken version happened to get right.
One operational addition pays for itself. Log the schemaHash per tool name when the reconciler initializes. The day an upstream server quietly revises its schema, the change shows up as a diff in your logs instead of as a mysterious uptick in misrouted tool calls. Before I had that, I spent half a day looking for the cause in my prompts.
Code you published yourself is the code you are least likely to re-examine. A hash function is especially good at hiding, because it always returns something.
Reconciler v2 in one file, with a test you can run
The fixes so far — prefix only on collision, provenance tags, a canonical schema hash — were added section by section, so the code ended up scattered. Below is the version I actually run, consolidated, plus sanitizing for the dotted names the MCP spec allows. schema-hash.ts is the fixed version from the previous section, taking the input_schema directly.
// reconciler.ts (v2: sanitize, prefix only on collision, provenance tag, fingerprint)import { createHash } from "node:crypto";import type { Tool } from "@anthropic-ai/sdk/resources/messages";import { schemaHash } from "./schema-hash.ts";export interface ServerToolBundle { serverId: string; // lowercase, 3-10 chars ("github" | "linear" | ...) label: string; // display name for the provenance tag tools: Tool[];}export interface ToolRoute { serverId: string; original: string; hash: string }export interface ReconciledTools { tools: Tool[]; // what goes to the Messages API forward: Map<string, ToolRoute>; // sent name -> origin server and original name fingerprint: string; // fingerprint of the whole list (cache key, logs)}const SEP = "__";const API_NAME_RE = /^[a-zA-Z0-9_-]{1,128}$/; // Messages API tools[].nameconst MAX_LEN = 64; // my own cap, short enough to read in logs// MCP allows dots; the Messages API does not. Absorb it here.const sanitize = (name: string) => name.replace(/[^a-zA-Z0-9_-]/g, "_");export function reconcile(bundles: ServerToolBundle[]): ReconciledTools { const groups = new Map<string, number>(); for (const b of bundles) { for (const t of b.tools) { const key = sanitize(t.name); groups.set(key, (groups.get(key) ?? 0) + 1); } } const tools: Tool[] = []; const forward = new Map<string, ToolRoute>(); for (const b of bundles) { for (const t of b.tools) { const base = sanitize(t.name); const collided = (groups.get(base) ?? 0) > 1; const name = collided ? `${b.serverId}${SEP}${base}` : base; if (!API_NAME_RE.test(name) || name.length > MAX_LEN) { throw new Error(`invalid tool name after reconcile: ${name}`); } if (forward.has(name)) { // e.g. "a.b" and "a_b" on the same server. Never overwrite silently. throw new Error(`name still collides after prefixing: ${name}`); } const tag = `[${b.label}]`; const desc = t.description ?? ""; const description = collided && !desc.startsWith(tag) ? `${tag} ${desc}`.trim() : desc; forward.set(name, { serverId: b.serverId, original: t.name, hash: schemaHash(t.input_schema) }); tools.push({ ...t, name, description }); } } const lines = [...forward.entries()] .map(([n, r]) => `${n}\t${r.serverId}:${r.original}\t${r.hash}`) .sort(); const fingerprint = createHash("sha256").update(lines.join("\n")).digest("hex").slice(0, 12); return { tools, forward, fingerprint };}
Three reasons for the shape. Sanitizing happens before collision counting: pages.search and pages_search become the same name by the time they reach the API, so you have to count sanitized names or you'll miss the collision. Names that still collide after prefixing throw instead of overwriting, because the original incident was precisely a silent disappearance. And fingerprint collapses the whole list into one value you can use as part of a prompt cache key or diff in logs.
Upstream servers choose the names; the bundling layer decides what reaches the API. That was the line I kept in front of me while rewriting this.
The dispatcher returns unknown names as an is_error: truetool_result rather than throwing.
// dispatcher.ts (unknown names return a tool_result listing the options instead of throwing)import type { ToolUseBlock, ToolResultBlockParam } from "@anthropic-ai/sdk/resources/messages";import type { ToolRoute } from "./reconciler.ts";export interface MCPClient { callTool(name: string, args: Record<string, unknown>): Promise<string>;}export async function dispatch( block: ToolUseBlock, forward: Map<string, ToolRoute>, servers: Map<string, MCPClient>,): Promise<ToolResultBlockParam> { const route = forward.get(block.name); if (!route) { const names = [...forward.keys()].join(", "); return { type: "tool_result", tool_use_id: block.id, is_error: true, content: `Tool "${block.name}" does not exist. Available tools: ${names}`, }; } const server = servers.get(route.serverId); if (!server) { return { type: "tool_result", tool_use_id: block.id, is_error: true, content: `Server "${route.serverId}" is not connected right now.` }; } const text = await server.callTool(route.original, block.input as Record<string, unknown>); return { type: "tool_result", tool_use_id: block.id, content: text };}
The test uses only Node's built-in runner — nothing to install.
// reconciler.test.tsimport { test } from "node:test";import assert from "node:assert/strict";import { reconcile } from "./reconciler.ts";import { dispatch } from "./dispatcher.ts";import { schemaHash } from "./schema-hash.ts";const issue = (required: string[]) => ({ type: "object", properties: Object.fromEntries(required.map((k) => [k, { type: "string" }])), required,});const gh = { serverId: "github", label: "GitHub", tools: [ { name: "create_issue", description: "Create a new issue", input_schema: issue(["repo", "title"]) }, { name: "list_prs", description: "List pull requests", input_schema: issue(["repo"]) },] };const ln = { serverId: "linear", label: "Linear", tools: [ { name: "create_issue", description: "Create a new issue", input_schema: issue(["team_id", "title"]) },] };const nt = { serverId: "notion", label: "Notion", tools: [ { name: "pages.search", description: "Search pages", input_schema: issue(["query"]) },] };test("prefix only colliding names and tag their descriptions", () => { const r = reconcile([gh, ln]); console.log(r.tools.map((t) => `${t.name} | ${t.description}`).join("\n")); assert.deepEqual(r.tools.map((t) => t.name), ["github__create_issue", "list_prs", "linear__create_issue"]); assert.equal(r.forward.get("linear__create_issue")?.original, "create_issue");});test("dotted MCP names are sanitized and still resolve to the original", () => { const r = reconcile([nt]); assert.equal(r.tools[0].name, "pages_search"); assert.equal(r.forward.get("pages_search")?.original, "pages.search");});test("names that still collide after sanitizing throw", () => { const bad = { serverId: "notion", label: "Notion", tools: [ { name: "pages.search", input_schema: issue(["q"]) }, { name: "pages_search", input_schema: issue(["q"]) }, ] }; assert.throws(() => reconcile([bad]), /still collides/);});test("changing one schema field changes the fingerprint", () => { const a = reconcile([gh, ln]).fingerprint; const gh2 = structuredClone(gh); (gh2.tools[0].input_schema.properties as any).repo = { type: "object" }; const b = reconcile([gh2, ln]).fingerprint; console.log(`fingerprint: ${a} -> ${b}`); assert.notEqual(a, b); assert.equal(schemaHash({ b: 1, a: 2 }), schemaHash({ a: 2, b: 1 }));});test("unknown tool names come back as an is_error tool_result", async () => { const r = reconcile([gh, ln]); const res = await dispatch( { type: "tool_use", id: "toolu_1", name: "create_issue", input: {} } as any, r.forward, new Map(), ); console.log(res.content); assert.equal(res.is_error, true);});
Here is an excerpt of node --experimental-strip-types --test reconciler.test.ts on Node v22.23.5 (Linux). That flag is what lets you import .ts files directly; if you build with tsc, you'll need allowImportingTsExtensions or rewritten extensions. Type-only imports are erased at runtime, so the test passed without @anthropic-ai/sdk installed.
# github__create_issue | [GitHub] Create a new issue# list_prs | List pull requests# linear__create_issue | [Linear] Create a new issue# fingerprint: b54e13e2a302 -> d7feeadd8d35# Tool "create_issue" does not exist. Available tools: github__create_issue, list_prs, linear__create_issue# tests 5# pass 5
The non-colliding list_prs keeps its name and description; only the two colliding tools get a prefix and a tag. You can also see the fingerprint change after editing a single field type.
Telling the symptoms apart
When an agent misbehaves, I start from the left column of this table. Separating "the tool names are wrong" from "the prompt is wrong" early is what saves the half day.
Symptom
Likely cause
How to check
Fix
A tool on the wrong server gets called
Same-name tools were folded into one in your bundle
Count names in the tools array right before sending
Prefix only colliding names and add provenance tags
The API returns 400 right after you add a server
An upstream tool name contains a dot or another character the API rejects
Check each tools[].name against ^[a-zA-Z0-9_-]{1,128}$
Sanitize in the reconciler and resolve the original through forward
Caching stops working right after a server connects
Tool definitions changed, invalidating the whole cache
Watch whether usage.cache_read_input_tokens drops to 0
Swap at turn boundaries and log fingerprint changes
The model calls a name that doesn't exist
A name from the previous turn disappeared, or the first turn dropped the prefix
Count dispatches for names missing from forward
Return an is_errortool_result listing options; add one line to the system prompt asking for full names
Argument errors rise after an upstream update
An input_schema changed quietly
Diff the per-name schemaHash log from startup
Read the diff, then align descriptions and callers
Three misconceptions worth correcting
"If I use the Agent SDK, I don't need collision handling." Half true. Anything you leave to mcpServers gets mcp__<server>__<tool>, but the moment you build even one path where your own MCP client feeds the Messages API, that array is yours to manage.
"A valid MCP tool name is a valid API tool name." It isn't. The MCP spec allows dots; the Messages API name allows only letters, digits, underscores, and hyphens. Bridging the two specs is the bundling layer's job.
"Tools sit before the system prompt, so changing them leaves the conversation cache alone." The opposite. The cache builds from tools outward, so a tool change invalidates everything after it, system and messages included. Being first is exactly why it matters most.
Name server IDs by capability, not by project
Someone publishes a server, you fold it into your agent, and you read tool names to infer intent. Designing for collisions with strangers' servers is closer to basic courtesy than to defensive engineering — the collision is not their fault.
In production I switched from project-scoped server IDs to capability-scoped ones (admob, slack, github). When several projects pull from the same AdMob account, write to the same Slack workspace, and commit to the same GitHub organization, capability-based IDs let one server registration serve all of them. The reconciler output stays more stable too, which keeps prompt cache breakpoints intact.
The takeaway is that adding more MCP servers is not free. For each agent task I now ask "which tools does this actually need", and I bundle accordingly. AdMob aggregation does not need the GitHub MCP; a PR review does not need the Slack MCP. Task-specific bundles keep the reconciler output deterministic, and a deterministic tool list is what keeps the cache hot.
What you hit after the collisions are gone: tool weight
If you do one thing today, call list_tools on every server you currently bundle and group by name to count the actual collisions. You will probably find more than you expected. Prefixing and description normalization can both wait until you have that list in front of you.
And if you already have a schema comparison of your own in place, feed it two inputs that differ in one nested field and confirm the value changes. I ran mine for three months without checking.
MCP is still in the phase where multiple vendors are publishing servers with their own naming traditions, and the variance will widen before it narrows. A reconciler layer turns server churn from a code change into a configuration change, which keeps your agent code stable and your shipping pace steady.
I share more half-formed notes from this work over on my stand.fm channel when I have something worth saying. Thanks for reading this far.
Share
Thank You for Reading
Claude 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.