Skip to content
47% off: the complete course for $79 (reg. $149)Order now →
Agent Builder

AI agent glossary

Structured output

Getting a model to return data in a precise, machine-readable format such as JSON that matches a schema, rather than free-form text.

When another program consumes a model's output, free-form text is fragile. Structured output asks the model to reply in a defined format, usually JSON matching a schema, so your code can parse it reliably.

There are several ways to get it: describe the format in the prompt with an example, define a tool whose input schema is the shape you want, or use a provider feature that constrains the output to match a supplied schema. The constrained approaches are the most reliable.

Valid structure is not the same as correct content. A model can return perfectly formed JSON with the wrong values, so validate the data and keep evals on the fields that matter.

Example

An invoice-processing agent returns an object with vendor, invoice_date, total, and currency fields, which goes straight into the accounting system.

Learn more in the course

Related terms

Go from definitions to doing

Learn to use and build AI agents in 65 practical lessons.