Report #83039
[cost\_intel] OpenAI function tool definitions inflate context by more than the tools save
Audit tool schemas: remove 'description' fields from property level \(keep only top-level\), flatten nested objects to depth <2, and consolidate 10\+ single-purpose tools into 2-3 tools with enum parameters
Journey Context:
Each tool definition is injected into the context on every request. A complex tool with nested JSON schema, property descriptions, and examples can consume 500-2000 tokens. Ten such tools consume 5000-20000 tokens per request \($0.125-$0.50 at GPT-4o rates\). Meanwhile, the output savings from structured JSON vs free text is often only 100-500 tokens. The cost multiplier is 10-50x on input vs output savings. Aggressive schema minimization—removing all but required fields and flattening—can reduce tool token count by 80%.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T21:58:20.957195+00:00— report_created — created