What description is for
outputSchema is mostly typed constraints — type, enum, pattern, minimum/maximum, minItems/maxItems — but every node also accepts a free-form description. That’s your second prompting surface, after instructions. It runs lower in the prompt hierarchy but is uniquely per-node: each description only steers the field or item it’s attached to.
Use description when guidance is scoped to one slot in the output and would be wasteful (or confusing) if you put it in section-wide prompts.
Where description lives
Every node in an outputSchema accepts a description. The most common places:
- Top-level node — the whole section’s output. Often a one-sentence summary of what this section produces; sometimes carries structural directives.
items(on an array) — describes one entry in the array. Repeated guidance per item.- Per-field (on
object.fields[]) — the targeted slot. This is the most useful place. - Nested field’s
valuenode — for typed leaves that need their own per-field guidance.
Three jobs description does well
1. Scope guidance per field
When anobject has many fields, a one-line description per field tells the model exactly what belongs in that slot — with precision and clarity inside the schema.
From corti-objective:
contentPrompt stays high-level (“Include direct findings from the physical examination …”); the schema descriptions carve up the body-region anatomy.
2. Layered guidance per schema node
Let’s take the desired output format for a Past Medical History section, e.g.corti-past-medical-history:
description in the hierarchy steers exactly one layer of the output:
array.description— the section-wide goal: a list of past conditions, one per line, with optional time prefixes. The model reads this once to understand the section’s overall job.items.description(theobjectnode) — what one entry in the list represents: a past medical history entry composed of an optional time prefix and a condition. This is the anatomy of a single item — every item the model produces is shaped by this guidance.prefix.description— the targeted rule for just the time-prefix slot: format with trailing colon and space; empty string when no time reference is documented. The model never has to remember this rule while reasoning about the condition itself.content.description— the targeted rule for just the condition slot: the actual diagnosis, procedure, or event description.
fieldFormat: "{prefix}{content}" then literally renders the two filled slots into the per-item string.
Why this is more robust than one big paragraph prompt:
- Each rule is local. The model isn’t asked to remember the prefix-formatting rule while extracting the diagnosis. Each
descriptionsits next to the field it governs, so the relevant guidance is always in the model’s immediate context for that slot. - The output renders itself.
fieldFormatdoes the literal layout — once the model fills the slots correctly, the colon-and-space, the line breaks, the ordering are guaranteed. You’re not relying on the model to remember formatting rules at generation time. - You get structured output. The response is an array of
{prefix, content}objects, not a free-text blob. Downstream systems can parse, validate, sort, or post-process each entry — no fragile regex needed to recover structure that was lost when the model rendered the prose. - Typed constraints compose for free. Add
enumtoprefix.valuefor a closed vocabulary of time formats,minItems/maxItemson the array,patternfor a strict prefix regex — each lives next to the description it qualifies and gets enforced, not just steered.
3. Per-field fallback conditionals
Fromcorti-allergies:
description as conditional defaults are not supported.
4. Explain how to use enum options
enum enforces what’s allowed; description explains when to pick which value. From corti-mental-status-exam:
customLabel instead. enum alone can’t express that interplay; the descriptions carry it.
Anti-patterns
- Don’t restate
contentPromptscope here. Section-wide “what to include” belongs in Recipe 1. Schemadescriptionis for this slot only. - Don’t restate
writingStylePromptvoice here. Section-wide tone/register belongs in Recipe 2. If every field’sdescriptionsays “use concise medical language”, move it up. - Don’t write a description longer than the rule it enforces. A leaf-field
descriptionis usually one sentence. If you’re writing three, the field probably needs to be split, or the rule belongs inmiscPrompt. - Don’t restate what
enum/patternalready enforces. “Use one of: PO, IV, IM …” indescriptionis redundant when those are theenumvalues. Usedescriptionto explain why / when, not what. - Don’t leave descriptions empty when the field is non-obvious. Empty descriptions on cryptic field keys (
prefix,trailer,stdLabel) make the model guess. The corpus consistently populates them.
Related
- Section Schemas — schema mechanics (node types,
enum,pattern,itemFormat,fieldFormat) and worked clinical examples. - Recipe 1 — contentPrompt — section-wide what to include.
- Recipe 2 — writingStylePrompt — section-wide voice and shape.
- Recipe 3 — miscPrompt — fall-back guardrails that span the whole section.