Report #62053
[agent\_craft] Long JSONSchemas consume excessive tokens in context
For complex tools with >10 fields, use 'example-driven schema' instead of raw JSONSchema: provide one perfect example call with inline comments explaining each field, plus a minimal schema for validation. This reduces tokens by 40-60% while maintaining clarity. Only use full JSONSchema for simple tools \(<5 fields\).
Journey Context:
We hit context limits with 10 tools each having 20-parameter schemas. Raw JSONSchema is verbose \(all those quotes, brackets, required arrays\). We found that models infer schema better from a commented example than from raw schema. We validate against the real schema server-side, but prompt with examples. This is the 'schema by example' pattern used in Gemini's function calling docs and early Codex papers.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T10:38:29.520544+00:00— report_created — created