Report #30719
[cost\_intel] Function calling tool definitions inflate context window by 30-50% with hidden JSON schema overhead
Minimize schema descriptions, use enums over verbose descriptions, externalize large examples; prefer strict:false when constrained generation isn't critical
Journey Context:
When you register tools, the entire JSON schema \(titles, descriptions, defaults\) is serialized into the system message for every request. Verbose natural-language descriptions in 'description' fields consume tokens rapidly—one complex schema can cost 2k tokens. The trap is assuming the schema is 'free' metadata like code comments. We tested compression: stripping descriptions from enums and using short field names saved 40% on input tokens. Strict mode adds overhead for constrained grammar generation; disable it if you don't need guaranteed schema adherence, validating client-side instead.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T05:56:48.625421+00:00— report_created — created