MockCertMockCert
Menu

Claude conceptsClaude Certified Architect – FoundationsPrompt engineering

CCAR-F prompt engineering and structured output

What CCAR-F asks about explicit review criteria, few-shot examples and structured output, and which method actually guarantees schema-valid JSON.

By MockCert Editorial3 min readPublished Nov 3, 2026

The exam guide calls few-shot examples the most effective fix when detailed instructions alone give inconsistent output. Structured outputs go further: constrained decoding guarantees schema-compliant responses.

01 What does CCAR-F test about prompts and structured output?

You reread a prompt that says "be conservative" and wonder why it still fails. The exam guide says general instructions like that fail to improve precision compared to specific categorical criteria.

Expect questions on explicit criteria, few-shot examples, and extraction that returns null instead of invented values.

Name what to report and what to skip; vague caution words do not raise precision.

02 When are few-shot examples the right fix?

Examples help the model generalize judgment to new patterns instead of matching only the cases you listed. For ambiguous cases, the guide suggests 2-4 targeted examples that show why one action beat plausible alternatives.

Anthropic's consistency guidance agrees: examples of the output you want work better than abstract instructions.

The trap: when tool selection fails because descriptions are minimal, examples add tokens without fixing the root cause.

Use few-shot examples for format and judgment, not to patch thin tool descriptions.

03 Which method guarantees structured output?

Ways to get structured output compared: what each guarantees

Output styles

  • Instructions Claude follows
  • No guarantee it always happens
  • Use a hook for every-time steps

Structured outputs

  • Constrained decoding against your schema
  • Responses always match the schema
  • No more JSON.parse() errors

Strict tool use

  • strict: true on the tool definition
  • Tool input follows its input_schema
  • Tool name is always valid
Structured outputs and strict tool use enforce your schema; an output style is an instruction Claude follows, not a guarantee.

Structured outputs use constrained decoding, so every response complies with your JSON Schema. Setting strict: true on a tool does the same for tool inputs through grammar-constrained sampling.

A Claude Code output style is different: Claude follows it, but it does not guarantee that something always happens, so use a hook for that.

Need schema-valid output every time? Use structured outputs; an output style is followed but not guaranteed.

04 What should the schema do when data is missing?

When some fields are absent from a document, the guide wants the model to return null rather than invent values. The Agent SDK docs give the matching advice: make fields optional when the task might not have that information.

In the Agent SDK, validated data arrives in the result message's structured_output field. Strict schemas also allow at most 24 optional parameters per request.

Make absent fields optional so the model never has to fabricate them.

Summary

  1. Replace vague instructions with specific report-and-skip criteria.
  2. Use 2-4 targeted few-shot examples for ambiguous cases.
  3. Structured outputs and strict tool use guarantee schema-valid output.
  4. Optional fields let the model leave out what it cannot find.

Sources and editorial status

Research checked Nov 3, 2026.

  1. Claude Certified Architect – Foundations Exam Guide Version 1.0 · Effective July 2026 · Exam code: CCAR-F · This guide i
  2. Structured outputs - Claude Platform Docs
  3. Increase output consistency - Claude Platform Docs
  4. Strict tool use - Claude Platform Docs
  5. Output styles - Claude Code Docs
  6. Get structured output from agents - Claude Code Docs