MCP tool description truncation at 2048 chars is silent, unconfigurable, and can leave a misleading prefix (follow-up to #41593, #81268)

Status Open
Reported on v2.1.234
Maintainer reply None cached
Activity 0 comments · opened Aug 18, 2026

Summary

MCP tool description fields are silently truncated to 2048 chars before being assembled into the model's context. There is no log line, no setting to override it, and the /mcp UI shows the untruncated text — so an author verifying their tool description in /mcp sees content the model never receives. Worse, for tools whose description embeds a usage contract (e.g. a TypeScript interface for a generic "execute" tool), the surviving 2048-char prefix can look complete and closed while critical fields are documented only past the cut — the model then confidently uses a wrong, narrower API with no signal anything is missing.

This is a follow-up to #41593 and #81268, adding a controlled same-day comparison and a new "misleading prefix" failure mode neither prior issue covered.

Verification

Binary: /Users/victorb/.local/share/claude/versions/2.1.234 (Claude Code v2.1.234, macOS darwin 25.5.0).

LC_ALL=C grep -aoE '.{160}Tpe\b.{80}' /Users/victorb/.local/share/claude/versions/2.1.234 | head

The minified constant Tpe=2048 gates it. The MCP tool wrapper contains (verbatim from the binary):

async description(){return W},async prompt(){return W.length>Tpe?ei(W,Tpe)+"… [truncated]":W}

description() — surfaced in the /mcp UI — returns the full string W. prompt() — what actually gets assembled into the model's context — truncates it. So the UI and the model see different text, with no indication of that divergence anywhere in the UI.

Server instructions truncation does log a debug line ("Server instructions truncated from X to 2048 chars"). Tool description truncation logs nothing anywhere.

Impact

Controlled comparison on one MCP server (an OpenAPI code-execution MCP server whose execute tool embeds its full usage contract in the tool description), same server, same day:

  • claude.ai receives the full description: 16,275 chars.
  • Claude Code (including Cowork)

receives 2,061 chars (2,048 + the 13-char "… [truncated]" marker) — 12.7% of the document.

Verbatim captures of the same server's tool schemas as received by Claude Code (truncated) and by claude.ai (complete) are attached to this issue.

The surviving prefix contains a TypeScript RequestOptions interface listing method, path, query, body, contentType, rawBody that looks complete and closed — but headers, bodyBase64, multipart, and returnAs are documented only past char 2048 (see attachments). The model has no way to know the interface it's looking at is incomplete, so it confidently calls the tool with a narrower, wrong API. None of this is logged, and /mcp shows the author the full, untruncated text, so the author has no way to notice the model is working from a different (and misleading) document.

Prior issues

  • #41593 — "MCP tool descriptions truncated at 2KB breaks code execution tools". Same diagnosis, on an earlier build (then WoH=2048, v2.1.84). Closed by the stale-bot with no decision.
  • #81268 (open) — "MCP truncation at 2048 chars is invisible". Documents the no-log and /mcp-mismatch aspects; reports 502 truncation events on one machine, worst case 10,780 → 2,048 chars.

This issue adds: a controlled claude.ai-vs-Claude-Code comparison on the same server/day, and documentation of the misleading-closed-interface failure mode (the truncated prefix isn't just short, it's shaped like a complete spec).

Requested fixes

  1. A server-settable per-tool override, e.g. _meta["anthropic/maxDescriptionChars"], mirroring the existing _meta["anthropic/maxResultSizeChars"] pattern already read by the binary (O._meta?.["anthropic/maxResultSizeChars"]) for result-size overrides. Keeps the tight default while letting code-execution tools opt in to a longer description.
  2. Log every tool-description truncation the same way server-instructions truncation is already logged.
  3. Make /mcp display the truncated text the model actually receives (or at minimum mark the cut point), so authors aren't debugging against a document the model never saw.
  4. Alternatively/additionally: a maxToolDescriptionLength setting in settings.json.

Environment

  • Claude Code v2.1.234
  • macOS darwin 25.5.0

Attachments

toolsearch_results_gmail_ba_codemode_sessionB.html
toolsearch_results_gmail_ba_codemode.html

View original on GitHub ↗