Two Budgets, Not One: Writing MCP Tool Descriptions for Claude Code's New Limits

  • Aanal Raj Basaula
  • 9 min read
Claude Code MCP tool description limits: 4,096 and 16,384 characters

Quick answer: Claude Code cuts MCP tool descriptions at a character limit, and Claude sees only the text before the cut. The limit used to be 2,048 characters. It is now 4,096 for tools that load upfront and for server instructions, and 16,384 for tools that Claude loads through tool search, which is the default. So put what Claude needs to find and choose your tool in the first 4,096 characters, your contract zone.

This post explains what changed and how Claude Code loads your tools, then gives some tips for what to do on your side: how to lay out a description, what the override variable does now, and what to check in an existing server.


How Claude Code loads your tools

Claude Code uses tool search by default, so it doesn’t put every MCP tool into the conversation at the start. A tool goes through three steps:

  1. Session start. Claude sees only tool names and your server instructions, up to 4,096 characters.
  2. Claude needs something. It searches for a matching tool. The search reads only the first 4,096 characters of each description.
  3. The tool loads. Claude now gets the full description, up to 16,384 characters.

So every description has two zones. They are the key idea of this post.

The contract zone

The contract zone is the first 4,096 characters of a description. Search always reads it, so it has to say what Claude needs to find and choose the tool: what the tool does, when to use it, when not to, and its hard constraints. We aim for about 1,500 characters. That figure is our rule of thumb, not Anthropic’s: it leaves headroom and keeps the opening readable.

The detail zone

The detail zone is everything after that, up to 16,384 characters. Claude reads it only once the tool has loaded. Formats, examples and error meanings go here. Don’t hide the purpose of a tool in this zone: a description that first says what it does at character 5,000 is a tool Claude may never find.

Example

server.registerTool("search_invoices", {
description: [
// Contract zone: search matches on this, so keep it short and put it first
"Search invoices by customer, status or date range. Use for billing history and unpaid or overdue invoices.",
"Do NOT use to create or change invoices (use write_invoice).",
"Requires billing:read. Returns at most 50 rows; use `cursor` to page.",
// Detail zone: how to use the tool once it is chosen. Past character 4,096,
// this reaches Claude only after the tool loads (up to 16,384)
"Dates are ISO 8601 (YYYY-MM-DD), inclusive. Amounts are integer cents.",
"Example: {status: 'overdue', from: '2026-10-01'}.",
"Error INVALID_RANGE means `from` is after `to`; swap them and retry.",
].join("\n"),
inputSchema: { /* zod schema with a description on every field */ },
annotations: { readOnlyHint: true },
}, handler);

The tool is simplified and illustrative. If a detail is vital to choosing the tool, it goes in the contract zone. If it only matters once Claude has chosen the tool, it can go in the detail zone. Structure that fits in the schema (types, enums, required fields) belongs there, not in prose.


What changed, with dates

Claude Code version Date Change
v2.1.84 2026-03-26 Descriptions and server instructions capped at 2KB, “to prevent OpenAPI-generated servers from bloating context”
v2.1.280 2026-09-22 CLAUDE_CODE_MAX_MCP_DESCRIPTION_LENGTH added to change the cap
v2.1.295 2026-10-08 Descriptions loaded through tool search cut at 16,384 instead of 2,048
v2.1.296 2026-10-09 Upfront descriptions and server instructions raised from 2,048 to 4,096

The changelog has the full history. Later releases changed how Anthropic’s own hosted servers are treated, which doesn’t affect your server.

There is nothing to switch on. Users get the new defaults when they update Claude Code, and your server code doesn’t need to change. Users on older versions still get 2,048. The docs document only the cut itself, not an error or a rejected tool, so a long description is shortened, not refused.

The limit comes from the client. The MCP spec calls a tool description an optional human-readable string and sets no length for it. Other clients may behave differently, and this post doesn’t cover them.


Which limit applies to your tool

Tool search isn’t always on. Some tools load upfront, at session start, together with their full description. Those tools get only 4,096 characters, so they have a contract zone and no detail zone. A tool loads upfront, for example, when:

You can’t know which case your users are in, so write for the strictest one: everything Claude needs to choose the tool goes in the contract zone.

Two more things to know. Claude Code versions before v2.1.295 and v2.1.296 still cut at the old 2,048, so keep the single most important line first. And tool search has been the default behind an ANTHROPIC_BASE_URL gateway since v2.1.304, so older advice that it is off there is out of date.


Server instructions are worth writing now

Instructions load at session start and, per the docs, help Claude decide when to search for your tools. Anthropic asks for three things: what category of tasks your tools handle, when Claude should search for them, and the key capabilities. They get the 4,096-character budget too. Keep them to that brief rather than a sales pitch or a copy of every tool description.

Billing tools for invoices, customers and subscriptions. Search for these tools
when the user asks about what a customer owes, payment status, or billing history.
Read tools: search_invoices, get_customer. Write tools: write_invoice, which
always creates a draft first.

The override variable now sets both limits

CLAUDE_CODE_MAX_MCP_DESCRIPTION_LENGTH takes one number and uses it for both limits. The catch: with 8192 you raise the 4,096 limit, and you lower the 16,384 one. Anyone who set it to work around the old 2,048 cap may now be cutting deferred descriptions below the default. The variable requires v2.1.280 or later.

Do this: if your docs or setup guide tell users to set it, say so and revisit that advice. Without a reason to lower it for context, they can remove it.


Tradeoffs: longer isn’t always better

More room helps, because Anthropic calls detailed descriptions “by far the most important factor in tool performance”. It also asks you to write them as you would brief a new hire.

Cost works differently per mode:

  • Upfront tools use context in every session. The docs say to reserve upfront loading for “a small number of tools that Claude needs on every turn.” Anthropic reports that a multi-server setup can use about 55k tokens in definitions, and that tool selection gets worse past roughly 30–50 available tools.
  • Deferred tools cost context only when loaded, so a long detail section is cheap there. Only the front of the description helps Claude find them.

The 2KB cap exists because of servers generated from OpenAPI specs, which bloated context. If you wrap REST endpoints, a bigger limit isn’t a reason to paste the endpoint docs into every description. Write each one by hand, or generate the opening and edit it.


Migration checklist

  • Find descriptions the old 2,048 limit cut and reread what Claude now sees. Text you trimmed to fit (constraints, examples, error meanings) may fit in the detail zone now.
  • Keep your learn() or read-first tools unless you have a reason to drop them. They work in any client and keep upfront cost low, as covered in our MCP server design guide. Don’t undo them automatically.
  • Retire workarounds. If you patched Claude Code’s binary or told users to raise the cap, use the documented variable or the new defaults.
  • Test on the oldest Claude Code version you support. Before v2.1.295 and v2.1.296, the cut is still at the old 2,048, so keep the most important line first.
  • Add a length check to CI. The sketch below flags descriptions by the limit they could hit:
const tools = (await client.listTools()).tools;
for (const t of tools) {
const n = t.description?.length ?? 0;
const upfront = t._meta?.["anthropic/alwaysLoad"] === true;
if (n > 16384) fail(`${t.name}: ${n} chars, over the deferred limit`);
else if (upfront && n > 4096) fail(`${t.name}: ${n} chars, over the upfront limit`);
else if (n > 4096) warn(`${t.name}: ${n} chars, only the first 4,096 are searched`);
}
if ((client.getInstructions()?.length ?? 0) > 4096) fail("server instructions over 4,096");

Users can still change how a tool loads, so treat the alwaysLoad branch as the strict case rather than a guarantee.


FAQ

What is the MCP tool description limit in Claude Code?

4,096 characters for server instructions and for tools that load upfront, and 16,384 characters for tools loaded through tool search. Both were 2,048 before v2.1.295 and v2.1.296.

What happens if my description is longer than the limit?

Claude Code cuts it at the limit, and Claude sees only the text before the cut. The docs don’t describe an error.

Does the MCP specification limit description length?

No. The spec treats a tool description as an optional human-readable string. It only says tool names should be 1 to 128 characters.

Should every tool use the full budget?

No. Put what Claude needs to find and pick the tool in the first part, and add detail only where it changes how the tool is called. Upfront tools cost context in every session.


Write the descriptions, skip the plumbing

Descriptions are product work, and no platform can write them for you. Deploying the server, authentication and hosting are the same for every team, and MCP Express handles them, so your time goes into the tools in src/tools/ of the scaffold.

Try MCP Express today!

Further reading

Ship Production-Ready MCP Servers in Minutes.

Self-host MCP Express for free and connect your first system in under 5 minutes.

Get startedHave questions? Get support

Self-hosting is free · No credit card required · Setup in under 5 minutes