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
- Coding agents are heading toward an AI-writes, AI-reviews, human-approves workflow — aftahi_ai · 2026-07-22
- oMLX 0.5.2 adds Mac menu-bar stats, low-bit decode kernels, and faster downloads — awnihannun · 2026-07-22
- GitHub review bot hits its PR limit and forces a 39-minute cooldown — DanielLockyer · 2026-07-22
- Max reasoning effort appears to be mobile-only in Codex Remote, not desktop — GabGarrett · 2026-07-22
- A Reddit demo argues online stores should expose carts and pricing through MCP — gelembjuk · 2026-07-22
- Open-source AI SDK provider routes Vercel apps through a local Codex subscription — lgrammel · 2026-07-22