output_schema is the contract. When the prompt and the schema disagree about the shape, the schema wins. When the schema asks for more than the run can fill, the agent ships a partial result rather than failing, and the run still says completed. Schema design is the single biggest lever on whether cells come back filled.
The shape that works
Rules
Keep it flat and narrow
Aim for 5 to 8 fields per run. Wide schemas are the strongest predictor of partial output: in a recent month, dataset runs with 1 to 5 fields shipped a partial result 28% of the time; runs with more than 20 fields, 73% of the time. When a record needs 20 fields, use two agents: one to discover the entities, one to fill the columns, joined on your key. Use an array root for dataset building and for enrichment runs that pass a list ininput_data (a list of rows requires a table-shaped schema; a single object in input_data takes an object root). Research uses an object root. Nesting is allowed to five levels; stay at one.
Describe every field
The description is the prompt for that field. State what it is, the format, the unit, and the null rule.- Undescribed
- Described
Name fields for what they hold
ceo_name, not name. annual_revenue_usd_2025, not revenue. latest_round_year, not year. The name is read by the agent too.
Nullable for anything uncertain
Type uncertain fields as["string", "null"] and keep them out of required. Reserve required for identity fields the row cannot exist without. A required field the web cannot fill forces the agent to either invent a value or abandon the row.
A cited null is a good answer. The trust report grades a verified absence high.
Enums for judgments
Any field that is a classification or a yes/no gets an enum. Add a third value that separates “checked, and absent” from “could not be checked”:Numbers as numbers, dates as ISO strings
"price_usd": { "type": "number" } with “number only, no currency symbol” in the description. Dates as YYYY-MM-DD strings, stated in the description. Free-text numbers cannot be sorted or summed downstream.
Ask for a source URL, not a confidence score
When downstream systems need the evidence next to the value, add asource_url field per claim group. Never add confidence, reasoning or is_verified fields: the trust report already carries a graded citation per path, and asking the agent to grade itself produces a less reliable copy.
Wrong and fixed
- Nested array in an object
- $ref
- Constraint keywords
- Too wide
- Required but unknowable
Wrong (enrichment run):Three levels of arrays for one entity. The write phase exhausts its budget and ships a fragment.Fixed: one flat row per competitor in a dataset-building run, then a second enrichment run per competitor for products.
Hard limits
Allowed roots
The root must be one of:- An object with non-empty
properties - An array of objects (
items.typemust be"object"withproperties)
output_schema (or pass {}) to let the generator infer the shape from the prompt.
Supported examples
Object root with nullable fields:Rejected patterns
The API returns 422 when a schema violates these hard limits:
Move validation constraints into field
description text instead of JSON Schema keywords.
Unsupported examples:
Still accepted
These are not hard-failed:requiredarrays on objectsadditionalProperties: false- Nested
anyOf/oneOffor nullability (not at the root) - Enums within the size limits above
- Nested arrays of objects or primitives under an object root
Field maps are invalid
Each field must be a JSON Schema subschema, not a bare type string:Agent generation behavior
When creating or updating an Agent, the design path can infer and sanitize a schema from your goals and template. The generator strips unsupported keywords and fixes common mistakes (such as standalonenull) before validation.
When you pass an explicit output_schema on create, update, or run, it is validated immediately. Fix the schema and retry on 422.
Common validation errors
Example 422 response:
Next Steps
Writing the Task
Input, skill and goals
Evaluating Results
Completed is not done
Trust
How per-path claims are graded