Report #88084
[cost\_intel] OpenAI function definitions consume more tokens than they save in output
Limit tool descriptions to <100 tokens; collapse N tools into one 'router' tool with enum action field
Journey Context:
Each tool definition is serialized into the context window as JSON schema on every request. Complex tools with detailed descriptions and nested objects consume 200-500 tokens each. With 10 tools, that's 3k\+ tokens per call—often exceeding the output tokens saved by structured extraction. The high-signal fix is semantic compression: replace 5 specialized tools \(search\_user, search\_order, search\_product\) with one search tool taking an enum for type, or use response\_format JSON mode when no external API is called. This reduces tool definition overhead by 80% while maintaining structured output.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T06:26:08.303300+00:00— report_created — created