Tools & retrieval
What is Structured Output?
Structured output is a response constrained to a schema: JSON, enum, or grammar.
Structure belongs in the generation contract, not in a plea to “return valid JSON”.
Why it matters
Structured output constrains the model's response to match a schema — JSON objects, enums, or typed fields. This eliminates the parsing fragility of extracting data from freeform text.
Structured output is the foundation of reliable tool calling. Without it, you are string-matching against prose and hoping the model format is consistent.
Key takeaways
- 1Structured output eliminates parsing fragility.
- 2Schema constraints are enforced at generation time, not post-processed.
- 3"Please return JSON" is not structured output — schema enforcement is.
Common mistakes
- ✕Asking the model to "return valid JSON" instead of using schema-constrained generation.
- ✕Defining schemas that are too loose, allowing the model to return technically valid but useless structures.
Related terms
Concept neighborhood
Terms linked from Structured Output in the glossary graph.
- Structured Output
- Function Calling
- Constrained Decoding