The structured data extraction scenario turns documents — invoices, contracts, forms, emails — into records that downstream systems can trust. It concentrates on the prompt engineering and structured output domain, with reliability questions about scale and cost from context management.
The system you should picture
Documents arrive in a queue. For each, the application sends the document and instructions to Claude with a tool whose input schema is the target record, forces Claude to call that tool, validates the result in code, and stores it. Records that fail validation are retried with feedback or sent for human review. Archives of historic documents are processed in bulk.
Decisions the exam probes
Getting the shape right. Asking for "valid JSON" in prose fails occasionally. A required tool whose input schema is the record — or the structured-output feature — makes the shape explicit. With several tools available, naming the specific tool in tool_choice is what forces it.
Designing honest schemas. A field that is required but often absent from the source pushes the model to invent values. Making it nullable, with an instruction to return null when the document does not state it, keeps extraction faithful. Fixed vocabularies such as categories become enums with short definitions.
Separating inputs. Long documents, instructions and examples are wrapped in clearly named tags so example text is never mistaken for the document.
Validation and retry. Every record is validated in code. A failed record is retried with the specific error rather than resent unchanged, retries are capped, and persistent failures are queued for review. Truncated output is detected through the stop reason.
Scale and cost. Large archives with relaxed deadlines go through the Message Batches API at a lower price. A large reference document reused across many requests is a good candidate for prompt caching.
Common traps
- Filling missing values with defaults to pass validation.
- Using "any" when one specific tool must be called.
- Cleaning up inconsistent categories after the fact instead of constraining them.
- Retrying failures with the identical request.
- Sending a huge archive through the standard API as fast as possible.
How to practise
Pick ten real documents of one type and build an extractor with a forced tool, a nullable field and an enum. Write a validator, then feed it documents that are missing fields or use odd category spellings. Track how many records pass first time, after one retry and never — the numbers will tell you which part of your design needs work.
The six scenarios are listed in Anthropic's official exam guide (version 1.1), with four drawn per sitting. The emphasis described here is our own study guidance, not official exam content.