PM-201a · Module 3
Output Schemas
4 min read
If you want structured output, specify the structure. This is not a suggestion — it is the only way to get consistent structured output at scale. "Return a JSON object" is not a schema. "Return a JSON object with the following keys: name (string), status (string, one of: active, inactive, pending), priority (integer 1-5), and notes (string or null)" is a schema. One of these produces reliable, parseable output. The other produces JSON-shaped guesses.
{
"output_format": "JSON array of objects",
"schema": {
"company_name": "string",
"contact_name": "string",
"contact_title": "string",
"deal_stage": "string — one of: prospect, qualified, proposal, negotiation, closed",
"estimated_value": "integer — in USD, no currency symbol",
"next_action": "string — one sentence describing the next required action",
"next_action_date": "string — ISO 8601 date format: YYYY-MM-DD",
"notes": "string or null"
},
"example_entry": {
"company_name": "Meridian Systems",
"contact_name": "Sarah Chen",
"contact_title": "VP of Operations",
"deal_stage": "proposal",
"estimated_value": 280000,
"next_action": "Follow up on Q2 budget approval status",
"next_action_date": "2026-03-15",
"notes": null
}
}
- 1. Define the structure type State whether the output is a JSON object, JSON array, markdown table, numbered list, prose paragraphs, or another format. This is the container. Every other schema detail builds on it.
- 2. Define the fields For structured output, list every field, its data type, and any allowed values. For prose output, list every required section and any constraints on each. "Prose with three sections" is a schema. So is "JSON with four typed fields."
- 3. Provide a concrete example Include a short, filled-in example of the desired output. One example is worth fifty lines of schema description. The model pattern-matches from examples more reliably than it parses abstract schema definitions.
- 4. Specify handling for missing values What should the model output when a required field has no value? Null, an empty string, "Not available," or omit the field entirely? Specify this explicitly, or accept inconsistent handling across outputs.