Optimizing Oversized MCP Tool Schemas
Anoop_kathait · reddit · 2026-07-11
The author encountered a specific issue with a self-hosted AI agent (Hermes Agent): even sending a simple "hi" included the full JSON schema of all enabled tools and MCP servers, causing input tokens to spike past 20,000.
Their mitigation strategies included:
- Disabling unnecessary tools, reducing the active count from 25 to about 12.
- Adding a thin proxy in front of the heavy MCP scraping server to expose only a single scrapeurl tool, compressing the schema from 20,000 tokens to 200 tokens.
- Configuring an automatic fallback provider to avoid repeated retries within the same free quota or rate limit window.
- Lowering the max iterations per turn and implementing a hard stop, suspecting some consumption came from internal agent loops.
They are also exploring two further optimizations: lazy-loading MCP tool schemas and automatically rotating multiple free API keys before failing over to another provider.
Related event: MCP Tool Schema Overload Impairs Agent Accuracy(3 posts)→
More from coding & agent
- GPT-6 Astra beats Factorio with enemies in 44 in-game hours at ~$4,500 API cost — liminal_bardo · 2026-09-11
- Investment Analyst Asks How to Build a Claude-Based Diligence Agent Stack — Careless_Tie2286 · 2026-09-11
- Treating agents like 50 First Dates: a 3-layer context system so every conversation doesn't start from zero — evielync · 2026-09-11
- Running the Firefox MCP on Android via Termux, ngrok, and mcp-proxy — Nervous-Strain7544 · 2026-09-11
- SmolVM open-sources persistent computer infrastructure for agents that outlive chat sessions — aniketmaurya · 2026-09-11
- ARRM targets silent economic regressions in AI agents that functional tests miss — Beautiful_Belt_601 · 2026-09-11