Optimizing MCP: Cutting tool schema context from 54k to 1.3k tokens
Pitiful-Surround-285 · reddit · 2026-08-19
The default MCP pattern carries a hidden cost: the model reads the full schema of every tool on every connected server, every turn, even before knowing which tool it needs.
In a stress test with a 217KB (54k tokens) schema, this consumed significant context, added latency, and increased input token costs.
The Fix: Stop showing the model the catalog entirely. It gets only two operations: search and execute.
- Search: Model describes intent in plain language (e.g., "create a support ticket") and receives compact cards (<1,800 bytes) with metadata.
- Execute: Model executes by an action ID; the bridge rebinds arguments and validates against the real schema server-side.
Result: Context usage dropped from 54k tokens to 1.3k tokens (97.7% reduction) without sacrificing execution accuracy. The model still calls the right tool with the right arguments, it just stops reading the "encyclopedia" first.
You can measure your own "schema tax" by diffing input token usage with and without MCP servers connected.
More from coding & agent
- Meteora launches $20k prize pool contest for AI trading agents on Solana — cardosofede · 2026-08-19
- Engineers struggle with AI agents because they aren't used to delegating system building — bendee983 · 2026-08-19
- dots3-note preview launches with support for multi-modal long-horizon task planning — LearnWithBishal · 2026-08-19
- AI agent dots3 speedruns an entire strategy game autonomously — LearnWithBishal · 2026-08-19
- iFixAi Open Source: 32 Inspections to Grade AI Agent Reliability — tom_doerr · 2026-08-19
- How to sync AI memory and settings across tools and devices? — RRRASHERRR · 2026-08-19