# Structured output with tool use and JSON schemas

*Claude Certified Architect - Foundations Study Guide · Prompt Engineering & Structured Output · Last updated October 22, 2026 · https://www.certifyforce.com/study-guide/claude-certified-architect-foundations/prompt-engineering-and-structured-output/structured-output-with-tool-use-and-json-schemas*

How strict tool use and JSON outputs (output_config.format) guarantee schema-valid structure but not correct values, how to read tool_use input, and how to design extraction schemas with required, nullable, "other" and "unclear" fields plus prompt normalization rules.

- Certification: Claude Certified Architect - Foundations
- Exam section: Prompt Engineering & Structured Output
- Study guide: https://www.certifyforce.com/study-guide/claude-certified-architect-foundations

**Official exam objective:**

> Enforce structured output using tool use and JSON schemas

## What the exam expects

- Replace "respond only with JSON" prompting with an extraction tool whose `input_schema` describes the record, `strict: true`, and code that reads the `tool_use` block's `input`.
- Choose between strict tool use and JSON outputs via `output_config.format` (not the deprecated `output_format`), and know that both guarantee schema-valid syntax but not semantically correct values.
- Pick the structured-output route for an extraction call, including when `tool_choice` must guarantee that a tool is called.
- Design schemas: required vs optional, nullable fields so Claude need not fabricate, `"other"` plus a detail string and `"unclear"` enum values, and no unsupported keywords such as `minimum` under strict mode.
- Put format normalization rules in the prompt beside the schema, and detect `max_tokens` and `refusal` responses that may not match the schema.

Key terms: **strict tool use** (`strict: true` on a tool; grammar-constrained sampling keeps tool inputs schema-valid); **JSON outputs** (`output_config.format` with `type: "json_schema"`, constraining Claude's reply text); **constrained decoding** (sampling restricted to schema-valid tokens); **nullable field** (a type array such as `["string", "null"]`); **semantic error** (schema-valid output with wrong values).

## Key facts

| Fact | Detail | Source |
|---|---|---|
| Strict tool use | `strict: true` constrains sampling so tool inputs match `input_schema` | [Strict tool use](https://platform.claude.com/docs/en/agents-and-tools/tool-use/strict-tool-use) |
| `tool_use.input` | Already an object conforming to `input_schema` | [Handle tool calls](https://platform.claude.com/docs/en/agents-and-tools/tool-use/handle-tool-calls) |
| JSON outputs | `output_config.format`, `type: "json_schema"`; result in the text block | [Structured outputs](https://platform.claude.com/docs/en/build-with-claude/structured-outputs) |
| `output_format` | Deprecated; 400 error without the beta header | [Structured outputs](https://platform.claude.com/docs/en/build-with-claude/structured-outputs) |
| Objects under strict | `additionalProperties` must be `false` | [Structured outputs](https://platform.claude.com/docs/en/build-with-claude/structured-outputs) |
| Unsupported keywords | `minimum`, `maximum`, `multipleOf`, `minLength`, `maxLength`: 400 error | [Structured outputs](https://platform.claude.com/docs/en/build-with-claude/structured-outputs) |
| Possible mismatch | `stop_reason` `refusal` or `max_tokens` | [Structured outputs](https://platform.claude.com/docs/en/build-with-claude/structured-outputs) |
| Complexity limits | 20 strict tools, 24 optional parameters, 16 union-type parameters per request | [Structured outputs](https://platform.claude.com/docs/en/build-with-claude/structured-outputs) |
| Semantic errors | Not prevented by strict schemas | [Exam guide](https://everpath-course-content.s3-accelerate.amazonaws.com/instructor%2F6nizmqk8tpzpfjvt6qmmav7rh%2Fpublic%2F1783542750%2FClaude+Certified+Architect+%E2%80%93+Foundations+Exam+Guide.pdf) |

## Check yourself

- Why does a strict extraction tool remove `json.loads()` failures that "respond only with JSON" prompting cannot?
- When should you use `output_config.format` instead of a strict tool?
- Why make an extraction field nullable rather than required non-null?
- Which two stop reasons mean a structured response might not match its schema?

## Sources

- [Structured outputs](https://platform.claude.com/docs/en/build-with-claude/structured-outputs)
- [Strict tool use](https://platform.claude.com/docs/en/agents-and-tools/tool-use/strict-tool-use)
- [Define tools](https://platform.claude.com/docs/en/agents-and-tools/tool-use/define-tools)
- [Handle tool calls](https://platform.claude.com/docs/en/agents-and-tools/tool-use/handle-tool-calls)
- [Claude Certified Architect – Foundations Exam Guide v1.0](https://everpath-course-content.s3-accelerate.amazonaws.com/instructor%2F6nizmqk8tpzpfjvt6qmmav7rh%2Fpublic%2F1783542750%2FClaude+Certified+Architect+%E2%80%93+Foundations+Exam+Guide.pdf)
- [Increase output consistency](https://platform.claude.com/docs/en/test-and-evaluate/strengthen-guardrails/increase-consistency)
- [Reduce hallucinations](https://platform.claude.com/docs/en/test-and-evaluate/strengthen-guardrails/reduce-hallucinations)
- [Get structured output from agents](https://code.claude.com/docs/en/agent-sdk/structured-outputs)

## About the full unit

The "Core concepts", "Exam traps" and "Worked scenario" sections of this unit, its 13 linked practice questions, and unlimited timed mock exams are included with the Claude Certified Architect - Foundations pack (USD $19): https://www.certifyforce.com/practice-exams
