CCA-F start here · Domain 4 · Extraction mind maps

Structured extraction mind maps

Everything the CCA-F exam asks about pulling structured data out of messy documents, on one page. It starts with which exam scenarios bring these questions. Then six mind maps, each in the form "what you see, where the fault is, the fix", with the rule to remember, the exam-guide line it comes from, and one practice question.

Domain 4 · 20%Domain 5 · 15%Guide 4.1–4.5, 5.1, 5.5About 30 minutes

Which scenarios ask about extraction?

The exam shows you 4 scenarios out of a bank of 6. One is about extraction directly. Two others reuse the same skills:

#ScenarioDomainsExtraction questions?Maps to study
6Structured Data ExtractionD4, D5Yes, the core one. Schemas, tool use, validation, retries, edge cases, human reviewAll six
5Claude Code for Continuous IntegrationD3, D4Partly. JSON findings, explicit criteria, few-shot, batch for overnight jobs1, 4, 5
1Customer Support Resolution AgentD1, D2, D5A little. Keeping exact facts (amounts, dates) in a “case facts” blockTrap 2 below
2Code Generation with Claude CodeD3, D5No—
3Multi-Agent Research SystemD1, D2, D5No (sources and citations instead)—
4Developer Productivity with ClaudeD2, D3, D1No—
What this means for you. If the four are picked at random, scenario 6 is on your paper about 2 times in 3. Scenario 5 or 6 (or both) is there about 14 times in 15. Domain 4 is 20% of the score whichever scenarios you get, so these maps pay off even without scenario 6.

Guide §5, scenario 6: “Structured Data Extraction — extract from unstructured docs, validate via JSON schemas, handle edge cases. (D4, D5)”

First, the picture: the extraction pipeline

Document invoice, PDF text Claude calls a tool whose input is your schema Validator do totals add up? Store Human review low confidence fails: send the exact error back and retry The schema stops broken JSON. The validator catches wrong values. Humans check what's uncertain.

The six maps at a glance

#QuestionUsual answerPractise
1How do you get JSON that always parses?A tool whose input is your JSON schema, with the right tool_choicetool_choice
2Claude makes up values. How do you design the schema?Optional or nullable fields, and "unclear" or "other" plus detail in enumsExtraction honesty
3Validation failed. Retry?Retry with the exact error, unless the data isn't in the documentExtraction honesty
4Output is inconsistent across documents2 to 4 few-shot examples. Explicit criteria when the instruction is vagueFew-shot, Explicit criteria
5Thousands of documents. Batch or now?Batch when nobody waits. Resubmit only the failures by custom_idBatch or now
6Can we stop human review?Only after checking accuracy by document type and fieldConfidence and sampling

A yellow row in each map is the runner-up: the case where a different answer wins because one fact in the question changes.

Mind map 1: How do you get JSON that always parses?

What you seeWhere the fault isFix
Sometimes the JSON is broken (a missing bracket, extra text around it)Claude is asked for JSON in plain textDefine a tool whose input schema is your JSON schema and read the tool call
Claude sometimes replies in text instead of calling the tooltool_choice is "auto", which allows texttool_choice: "any" (must call a tool)
There is one extraction tool and it must always runauto may skip itForce it: {"type":"tool","name":"extract_invoice"}
There are several schemas (invoice, receipt, contract) and the document type is unknownForcing one tool picks the wrong schema for other types"any", so Claude picks the right extraction tool
The JSON is valid, but line items don't add up to the totalA schema checks shape, not meaningAdd your own validation after extraction (map 3)
Rule: tool use with a JSON schema is the most reliable way to get valid JSON. Use any when any of several tools is fine, and force a named tool when it must be that one. A strict schema removes syntax errors, not wrong values.

Guide 4.3: “tool_use with JSON schemas = most reliable schema-compliant output (eliminates JSON syntax errors). tool_choice: "auto" (may return text), "any" (must call a tool), forced (specific named tool). Strict schemas eliminate syntax errors but not semantic errors.”

Example. A pipeline receives invoices, receipts and purchase orders mixed together. Each type has its own extraction tool. Sometimes Claude answers in prose instead. What should the request use?
  1. tool_choice: "auto" with a stronger system prompt
  2. tool_choice: "any"
  3. Forced tool_choice for extract_invoice
  4. Ask for JSON in the prompt and parse the text
B. A tool call is guaranteed, and Claude still picks the right type. A works most of the time, but text is still allowed. C works for invoices, but breaks the other two types. D gives no guarantee the JSON is valid.

Mind map 2: Claude makes up values. How do you design the schema?

What you seeWhere the fault isFix
A field like due_date is filled in even when the document has noneThe field is required, so Claude must put something thereMake it optional or nullable
A category is forced into the nearest wrong valueThe enum has no way outAdd "unclear" or "other" to the enum
Many documents land in "other" and you can't tell why“Other” has no detailAdd "other" plus a detail field, like category_detail
The field is always present in this document type (like an invoice number)Making it optional hides real extraction missesKeep it required
Rule: if a value might not be in the document, the schema must allow “not there” (null) or “not sure” (unclear). A required field with no source value invites a made-up answer.

Guide 4.3: “Optional/nullable fields prevent fabrication; enum "unclear"/"other" + detail for extensible categories.”

Example. About 15% of contracts have no renewal date. In those cases the extraction still returns a date, usually the signing date. Best fix?
  1. Tell Claude in the prompt not to guess dates
  2. Make renewal_date nullable in the schema
  3. Retry whenever the renewal date equals the signing date
  4. Add a few-shot example of a contract without a renewal date
B. The schema forces a value, so let it be null. A works sometimes, but the required field still pushes for a value. C retries can't find a date that isn't there. D helps, but it fights the schema instead of fixing it.

Mind map 3: Validation failed. Retry?

First ask one question: is the information in the document? If it is, a retry can fix it. If it isn't, no retry will.

What you seeWhere the fault isFix
A date is in the wrong format, or a field is in the wrong placeA format or structure mistakeRetry with the specific validation error added to the request
Retries keep failing the same wayThe retry just says “try again”Send the exact error (“line items sum to 410, total says 450”)
The value is simply not in the documentRetrying can't create itDon't retry. Return null or route to a human
Totals don't match and you can't tell if Claude or the document is wrongOnly one number is extractedExtract calculated_total and stated_total, with a conflict_detected flag
Reviewers keep dismissing the same kind of flagYou can't see which pattern caused itRecord a detected_pattern field and analyse the dismissals
Rule: retry with the exact error when the data is in the document but came out wrong. Never retry for data that isn't there. Let Claude report what it calculated next to what the document states.

Guide 4.4: “Retry-with-error-feedback: append specific validation errors on retry. Retries are ineffective when info is absent from the source. Self-correction: extract calculated_total alongside stated_total; conflict_detected booleans.”

Example. An extraction fails validation because invoice_date came back as “3rd March 2026” instead of YYYY-MM-DD. What should happen?
  1. Send it to a human reviewer
  2. Retry, including the error “invoice_date must be YYYY-MM-DD, got ‘3rd March 2026’”
  3. Retry with the same request
  4. Make invoice_date nullable
B. The date is in the document, only the format is wrong, so a retry with the exact error fixes it. A works, but it's slow and costly for a format slip. C may repeat the same mistake. D hides a value that does exist.

Mind map 4: Output is inconsistent across documents

What you seeWhere the fault isFix
Clear instructions, but output still varies from document to documentInstructions alone aren't enough2 to 4 few-shot examples of input and wanted output
Ambiguous cases are handled differently each timeNo example shows the edge caseExamples that show the ambiguous case and the reasoning for the choice
Documents come in very different layoutsExamples cover only one layoutExamples from varied document structures
Claude invents values that look plausibleNothing shows what “not there” looks likeA few-shot example with a missing value returned as null
The instruction itself is vague (“flag anything suspicious”)Claude doesn't know what countsExplicit categorical criteria first. Examples then show them in use
Rule: when instructions are clear but results are inconsistent, add a few targeted examples, including the hard cases. When the instruction is vague, write explicit criteria. “Be careful” or “only high confidence” fixes neither.

Guide 4.2: “Few-shot is the most effective technique for consistent, actionable output when instructions alone are inconsistent. Demonstrate ambiguous-case handling; reduce extraction hallucination. 2-4 targeted examples showing reasoning for the chosen action; handle varied doc structures.” Guide 4.1: “Explicit criteria beat vague instructions.”

Example. Receipts from different shops put the tax in different places. The instructions say “extract the tax amount”, and some receipts get the subtotal instead. Best fix?
  1. Add “be careful to pick the tax, not the subtotal” to the prompt
  2. Add three examples from different shop layouts, each showing which line is the tax and why
  3. Use a larger model
  4. Retry whenever tax is more than 30% of the total
B. The problem is varied layouts, and examples teach those directly. A works a little, but it's a vague warning. C doesn't show it the layouts. D catches some mistakes after the fact but doesn't prevent them.

Mind map 5: Thousands of documents. Batch or now?

What you seeWhere the fault isFix
A nightly or weekly load, and nobody waits for the resultPaying full price for speed nobody needsMessage Batches API: 50% cheaper, results within 24 hours
You need to match each result to its documentResults don't come back in orderGive each request a custom_id
Some documents in the batch failedResubmitting everything costs twiceResubmit only the failures, by custom_id
A user uploads a document and waits on screenBatch has no speed guaranteeReal-time requests
Extraction needs several rounds of tool calls (look up, then extract)One batch request can't do a multi-turn tool loopReal-time, or split into separate steps
Rule: use batch when nobody is waiting and each document needs a single request. Track every request with custom_id, and resubmit only what failed.

Guide 4.5: “Message Batches API: 50% cost savings, up to 24-hour window, no latency SLA. Batch API does not support multi-turn tool calling in a single request. custom_id correlates request/response; resubmit only failed docs by custom_id.”

Example. A nightly batch of 20,000 invoices finishes with 300 failures. What next?
  1. Rerun the whole batch
  2. Resubmit the 300 by custom_id in a new batch
  3. Process the 300 in real time
  4. Send the 300 to human review
B. It fixes only what failed, still at batch price. A pays for 19,700 documents twice. C works, but costs double and nobody is waiting. D works, but most failures may be simple to fix automatically.

Mind map 6: Can we stop human review?

What you seeWhere the fault isFix
Overall accuracy is 97%, so the team wants to stop reviewingAn average hides weak document types and fieldsMeasure accuracy by document type and by field first
You don't know how often high-confidence results are wrongNobody checks the confident onesStratified random sampling, including high-confidence results
You need to decide which results go to a humanThere's no trusted signal to route onField-level confidence, calibrated on a labeled set
Routing uses Claude's own “I'm 90% sure” with no calibrationSelf-reported confidence isn't reliableCalibrate it on labeled data before relying on it
Rule: don't trust one overall accuracy number. Check by document type and field, sample the confident results too, and route review using confidence that has been checked against labeled data.

Guide 5.5: “Aggregate accuracy (97%) can mask poor performance on specific doc types/fields. Stratified random sampling measures high-confidence error rates; field-level confidence calibrated on labeled sets routes review. Validate accuracy by document type and field before automating.”

Example. An extraction system is 98% accurate overall. Handwritten forms are 5% of the volume. The team wants to remove human review. What should they do first?
  1. Remove review, since 98% beats the target
  2. Measure accuracy separately for each document type and field, including handwritten forms
  3. Review only results Claude marks as low confidence
  4. Keep reviewing everything
B. A small weak group can hide inside 98%. A ignores that risk. C works only once confidence is calibrated. D works, but it throws away the gains the system could give.

Three traps that catch people

1 · Syntax or meaning?

A strict schema guarantees the JSON parses and has the right fields. It doesn't guarantee the numbers are right. If the question says “valid JSON but wrong totals”, the answer is validation, not a stricter schema.

2 · Long documents and exact facts

Claude reads the start and end of a long input best and may miss the middle. Put key facts at the start with clear headings, and keep exact values (amounts, dates, IDs) in a separate facts block instead of a summary that turns “$1,240 on 3 March” into “a refund last month”.

3 · JSON: the exam's answer vs today

Today's API also has other structured-output options, but the guide teaches “tool with a JSON schema” as the most reliable. On the exam, follow the guide. More on Exam vs 2026, item 1.

Guide 5.1: “‘Lost in the middle’: models reliably process beginning/end but may omit middle sections. Extract transactional facts into a persistent ‘case facts’ block.”

How to study this

  1. Read one mind map, then open its Trap Gym page. Change the setting and watch what happens.
  2. Do the D4 practice questions and D5 practice questions. For each one, say which row of which map decides it.
  3. Print this page and cover the Fix column. Can you fill it in from memory?

Related: Domain 4 hub · Domain 5 hub · Claude Code mind maps · MCP mind maps · Exam vs 2026 · all traps · CCA-F start here