- Symptom
- The compiled grammar is too large, which would cause performance issues. Simplify your tool schemas or reduce the number of strict tools.Schema is too complex for compilation.Each schema looks small, but the request fails once several strict tools are combined
- Cause
- Strict tools and output_config.format compile into one grammar per request, with limits on the combined total: 20 strict tools, 24 optional parameters, and 16 parameters with union types such as type string or null. Internal size limits and a 180 second compile timeout sit on top.
- Fix
- Set strict only on the tools that need it, make parameters required with explicit defaults instead of optional, avoid nullable unions, flatten nesting, or split strict tools across requests.
- Apply
// count across ALL strict schemas in one request const optional = schemas.flatMap(s => Object.keys(s.properties).filter(k => !(s.required ?? []).includes(k))).length; if (optional > 24) throw new Error('more than 24 optional params across strict schemas');- Affected
- Claude structured outputs (output_config.format) and strict tool use, as of 2026-10
- Sources
Last verified 2026-10-15 · Confirmed by 0 builders