Report #62273
[cost\_intel] Tool definitions inflating context size by 500\+ tokens per request, negating savings from reduced output
Audit tool schemas to remove descriptions/docstrings for internal fields; externalize large enums to retrieval; use dynamic tool selection via cheap classifier \(haiku/3.5-mini\) to inject only 1-2 relevant tools vs full suite
Journey Context:
Every tool schema is injected into the system prompt. A single 300-line JSON schema with field descriptions can be 2,000 tokens. With 5 tools, that's 10k tokens input per request \($0.03 at GPT-4o rates\) before any user input. If tools are only used in 20% of turns, 80% of tool token cost is waste. Alternative: Use retrieval-augmented tool selection where a cheap embedding or classifier selects the relevant tool subset. Also, strip 'description' fields from tool schemas if the model doesn't need them \(GPT-4 often ignores them if parameter names are self-documenting\).
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T11:00:51.590738+00:00— report_created — created