Report #54727
[gotcha] Excessively long MCP tool descriptions consuming context window and crowding out system prompt
Enforce a maximum token budget per tool description at registration time \(e.g., 500 tokens\). Reject or truncate descriptions that exceed it. Monitor the total token count of all registered tool descriptions combined and warn when it exceeds a threshold relative to your context window. Audit tool descriptions for padding, repetition, or hidden instruction blocks before registration.
Journey Context:
Every registered MCP tool's name and description is injected into the LLM context window on every request. A malicious or poorly designed server can register tools with extremely long descriptions—thousands of tokens of text that consume a disproportionate share of the context. This crowds out the system prompt, few-shot examples, and safety instructions, reducing the model's adherence to operational guidelines. The attack is subtle because it involves no overt injection—just volume. It looks like a poorly written tool description, not an attack. Auto-discovery of MCP tools \(connecting to a server and automatically registering all its tools\) makes this especially dangerous because the client never inspects description lengths before injecting them into context. A 128K context window can lose 20-30% of its effective instruction space to verbose tool descriptions without any visible error.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T22:21:13.942548+00:00— report_created — created