# Structured output

Getting the model to return machine-parseable data (usually JSON) that conforms to a schema you define.

## Why the CCAR-P exam tests this

The exam checks you know schema-valid JSON is not the same as semantically correct data — validation catches shape, not truth.

## Definition

Structured output means having Claude return data in a **predictable, parseable shape** — commonly JSON — so downstream code can consume it reliably. You get this by specifying the schema clearly, giving an example, and often by using **tool/function definitions** whose input schema constrains the fields and types.

The critical distinction: **schema-valid does not mean semantically correct**. The model can emit perfectly-formed JSON that parses cleanly yet contains a wrong value, a hallucinated field entry, or a mislabeled category. Schema validation guarantees **shape**, not **truth**. So you still validate the *content* — ranges, enums, referential checks, business rules — beyond just "did it parse."

Practical tips: define required fields and types explicitly, prefer enums for categorical fields, keep the schema as tight as the task allows, and handle the case where output must be repaired or re-requested. Structured output pairs well with tools, where the model's arguments are naturally schema-bound.

## Exam trap

"The JSON validated, so the answer is correct" is wrong — valid structure says nothing about whether the values are accurate; verify semantics separately.

## Commonly confused with

- **extended-thinking** — Thinking can improve the reasoning that fills the fields, but does not by itself guarantee schema validity or correct values.

## Related

- no-customer-fine-tuning
- extended-thinking
- context-window-management

---

Source: Claude Cert Prep — an independent, unofficial CCAR-P study resource (domain P2). Not affiliated with Anthropic.
