Claude Certified Architect — Foundations · Free practice question 6 of 10
Tool schemas for strict JSON conformance
You need to extract structured information from invoices and pass it to a downstream system that rejects any deviation from a strict JSON schema (every field required, no extras). Which approach gives the most reliable schema conformance?
- A.Define a tool whose input parameters are the schema and have Claude call it with the extracted values.
- B.Embed the schema in the prompt as text and instruct Claude to "output JSON that matches the schema exactly."
- C.Pre-fill the assistant turn with `{` and parse the completion as JSON.
- D.Generate freely and run a downstream JSON repair step.
Show answer and explanation
Correct answer: A. Define a tool whose input parameters are the schema and have Claude call it with the extracted values.
Why: Tool input parameters are validated by Claude's runtime against the declared schema — this is the highest-reliability path to conformance. Prompt-text schemas and pre-fills don't get machine-level validation; downstream repair masks problems instead of preventing them.
More free Claude Certified Architect — Foundations questions
- Narrowing label definitions to stop over-triggering
- Severity and confidence metadata for review findings
- Tool-based verification to prevent hallucinated APIs
- Precision vs recall trade-offs in extraction
- Evidence fields for auditable structured output
- Routing scarce human review capacity
- Execution-based evals for SQL generation
- Prompt caching for repeated context
- Shadow-mode rollout for prompt changes