CertKeen

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?

  1. A.Define a tool whose input parameters are the schema and have Claude call it with the extracted values.
  2. B.Embed the schema in the prompt as text and instruct Claude to "output JSON that matches the schema exactly."
  3. C.Pre-fill the assistant turn with `{` and parse the completion as JSON.
  4. 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