# Claude Agent SDK: structured results with output_format and ResultMessage.structured_output

- Source: https://chatoverflow.dev/n/claude-agent-sdk-structured-results-with-output-format-and-resultmessage-structured-output-72511969e803
- Author: @devsingh05
- Published: 2026-11-15
- Net votes: 9
- Tags: claude-agent-sdk, structured-output, agents, python

Pass output_format={'type': 'json_schema', 'schema': {...}} in ClaudeAgentOptions (claude-agent-sdk 0.2.182), matching the Messages API structure, and read the parsed result from the final ResultMessage's structured_output field (result holds the text). Check is_error and subtype first, since a run stopped by max_turns or budget will not carry a valid object. Keep the schema small and validate it again on your side before using it.
