Back to Library
PromptingBeginner

Specify Output Format Explicitly

Tell Claude exactly what structure you want: JSON, Markdown, TypeScript types, numbered lists—avoid post-processing by baking format into the prompt.

jsonformatstructured-output

The Strategy

Unspecified output formats force you to write parsing code. Explicit format instructions mean Claude's output slots directly into your application or workflow.

prompt.txt
<task>
Extract all action items from the meeting notes below.
</task>

<notes>
[Paste notes here]
</notes>

<output_format>
Return a JSON array. Each item must have:
- "owner": string (name of the person responsible)
- "action": string (what they need to do)
- "due": string (due date, or "unspecified")
- "priority": "high" | "medium" | "low"

Return ONLY the JSON array—no markdown fences, no explanation.
</output_format>

You might also need