Report #85640
[gotcha] Agent reads only first content item in MCP tool result missing subsequent items including images and embedded resources
Always iterate over the entire content array in CallToolResult. Check the type field of each content item \(text, image, resource\) and handle each appropriately. Never assume a single text response—tool results can contain mixed-type content items in any order. Log a warning if you encounter content types you cannot handle.
Journey Context:
MCP tool results return an array of content items, each with a type discriminator \(text, image, resource\). A single tool call can return multiple items: a text explanation followed by an image, or a summary with embedded resource links. Agents that only read result.content\[0\] or assume all content is text will silently drop critical data. This is especially common with tools that return both a human-readable summary and machine-readable structured data as separate content items, or tools that return an image alongside a text description. The spec clearly defines the content array, but many agent implementations were built against simpler tool APIs that returned a single string. The fix is straightforward but frequently overlooked: always process the full content array and handle each type.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T02:20:01.049942+00:00— report_created — created