Answer: Return images as image blocks in the `content` array and structured data via the optional `structuredContent` JSON object on the result. In a TypeScript `tool()` handler, setting `structuredContent` means Claude receives the JSON plus the image and resource blocks in `content`, while text blocks in `content` don't reach Claude. Status: Confirmed Entry: tool/claude-code/agents-and-automation/tool-return-images-structured-data Revision: 3 Digest: sha256:da3750179a0b2dbe (changes whenever the content changes) Timeline: Created: 2026-11-13T03:02:42Z Last changed: 2026-11-20T12:16:31Z (Python workaround: standalone MCP server → —) Last verified: 2026-11-20T12:16:31Z Next check: 2026-11-21T12:16:31Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Source | As of structured data field | structuredContent | [1] | 2026-11-20 image block type | image | [1] | 2026-11-20 image mime type | image/png | [1] | 2026-11-20 Python limitation | content | [1] | 2026-11-20 Sources: [1] Anthropic. "Give Claude custom tools". https://code.claude.com/docs/en/agent-sdk/custom-tools.md Role: primary. Accessed: 2026-11-20T12:16:31Z Quote: "`structuredContent` is an optional JSON object on the result, separate from the `content` array." (Supports: structured data field) Quote: "type: "image"," (Supports: image block type) Quote: "mimeType: "image/png"" (Supports: image mime type) Quote: "The Python `@tool` decorator forwards only `content` and `is_error` from the handler's return dict." (Supports: Python limitation) Published: 2026-11-20T03:17:49Z Snapshot SHA-256: b07693fa054e2dfa05152f984f16332c405b2cba4c21f6318b5de68348eeb640 (captured 2026-11-20T12:16:27Z) Verification: Method: Automated extraction from [1] with deepseek-flash (JSON output, thinking disabled). Every value was checked by code to appear verbatim in a quoted passage of [1]. Cross-check: not-available at 2026-11-20T12:16:31Z. No independent second source is configured for this entry Last successful check: 2026-11-20T12:16:31Z Last attempt: 2026-11-20T12:16:31Z Notes and limitations: Extracted automatically from a single official source (section "Return structured data"). Related: https://latestn.com/tool/claude-code/agents-and-automation/user-input-limitations What are the limitations of handling user input with the Claude Code Agent SDK? https://latestn.com/tool/claude-code/agents-and-automation/wait-for-subagents How do I make Claude wait for subagents to finish before continuing? https://latestn.com/tool/claude-code/agents-and-automation/what-is-a-hook What is a hook in Claude Code? https://latestn.com/tool/claude-code/agents-and-automation/structured-output-quick-start How do I get validated JSON structured output from a Claude Code agent? https://latestn.com/tool/claude-code/agents-and-automation/stub-claude-answers-in-test How do I stub what Claude Code would answer in a Claude Code mod test? https://latestn.com/tool/claude-code/agents-and-automation/test-timer-drawing How do I test a timer or a drawing in a Claude Code mod? https://latestn.com/tool/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-20T12:16:31Z | changed | Python workaround: standalone MCP server → — | [1] 2026-11-20T12:16:31Z | changed | Python limitation: The Python `@tool` decorator forwards only `content` and `is_error` from the handler's return dict. → content | [1] 2026-11-14T12:12:06Z | changed | Python workaround: — → standalone MCP server | [1] 2026-11-14T12:12:06Z | changed | Python limitation: content → The Python `@tool` decorator forwards only `content` and `is_error` from the handler's return dict. | [1] 2026-11-13T03:02:42Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/claude-code/agents-and-automation/tool-return-images-structured-data/latest Challenge this entry: Open challenges: None How: If a value here is wrong or out of date, send what is wrong and a link to evidence. Challenges are queued and checked against the evidence; they do not change the entry by themselves. If the entry changes as a result, the change log says so. Form: https://latestn.com/dispute/tool/claude-code/agents-and-automation/tool-return-images-structured-data POST: https://latestn.com/dispute/tool/claude-code/agents-and-automation/tool-return-images-structured-data with claim, evidence_url, and optionally field and contact (form-encoded or JSON) GET: https://latestn.com/dispute/tool/claude-code/agents-and-automation/tool-return-images-structured-data?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). How do I return images or structured data from a Claude Code custom tool? Revision 3, last verified 2026-11-20T12:16:31Z. https://latestn.com/tool/claude-code/agents-and-automation/tool-return-images-structured-data (accessed 2026-11-21T09:58:34Z). @misc{LatestN_tool_claude_code_agents_and_automation_tool_return_images_structured_data_r3, title = {How do I return images or structured data from a Claude Code custom tool?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/claude-code/agents-and-automation/tool-return-images-structured-data}}, note = {Revision 3; digest sha256:da3750179a0b2dbe; last verified 2026-11-20T12:16:31Z; accessed 2026-11-21T09:58:34Z} } Reuse: License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/) Attribution: Copying and adapting are allowed, including commercially, if you credit LatestN and link to the entry you used. Each entry ends with a ready-made citation. URL: https://latestn.com/tool/claude-code/agents-and-automation/tool-return-images-structured-data