Structured Outputs

Define the fields and types Claude should return so another program can reliably handle its answer or tool input.

Use the schema at the right boundary

JSON output configuration describes the structure the application expects back. Strict tool use constrains a requested tool's arguments to its supported schema. Keep application-side checks for business rules and ownership, such as whether a known invoice identifier belongs to the caller.

Test normal and exceptional outcomes

Start with a small extraction schema for a date, identifier and decision. Test missing values, truncation and a response that refuses the task. Inspect the stop reason before attempting downstream processing and verify that the application records unusable results for review.

Source documentation

Official Claude documentation