A schema failure looks like one incident in a dashboard and like one very specific thing in a trace. Before you touch the prompt, open the raw response and find the field the validator complained about. Then answer four questions in order: is the field missing, misnamed, mistyped, or present but wrong? Each answer points at a different layer and a different fix.
This is worth doing because structural fidelity is an operational prerequisite, not a cosmetic one. A semantically correct output that violates the expected contract is, from the consuming system's perspective, indistinguishable from a wrong answer the empirical study of structured output control. Your parser does not know the model meant well.
The four-question triage also separates cheap fixes from expensive ones. A missing field is usually a prompt problem. A misnamed field is usually a contract problem. A mistyped field is usually a schema ambiguity problem. A present-but-wrong field is often not a schema problem at all, and rewriting your schema will not fix it.
The decision tree
| What you see in the trace | Likely cause | First check | One-line fix | Relative cost |
|---|---|---|---|---|
| Required key absent | Prompt does not make the field salient, or the model judged it "obvious" | Diff prompt's field list against schema required array | Copy the schema's required array verbatim into the prompt and add one filled example | Low |
Key renamed (current_state instead of status) | Model inventing a label, or prompt and schema using different names | Grep the prompt for the exact key spelling | Use the schema's exact property names in the prompt and in every example | Low |
| Wrong type (integer id, string date) | Type not stated, or stated weakly | Check whether the schema declares type and whether the prompt repeats it | Add explicit type and format rules; prefer a format or pattern over prose | Low |
| Value outside allowed set | Enum missing or too open | Read the schema's enum list | Replace free text with an explicit enum and list every allowed value | Low |
| Everything present, values wrong | Data or reasoning problem, not a schema problem | Compare the value against the source text | Fix retrieval or give the model the source span | High |
| Nested object collapses to a string | Depth beyond what the model reliably emits | Count nesting levels in the schema | Flatten one level or split into two calls | Medium |
| Intermittent, input-dependent | Marginal capability for this schema complexity | Stratify failures by input length and schema size | Reduce schema complexity or move to a stronger model | High |
Read the table left to right. The cost column is what you pay in engineering time and blast radius, not in tokens. A validator change is a five-minute edit; a model change is a migration with evaluation runs.



