Skip to content

MCP tool results silently drop every non-text content block #823

Description

@Vasanthdev2004

Our MCP client models a tool-result content block as text only:

type Content struct {
	Type string `json:"type"`
	Text string `json:"text,omitempty"`
}

internal/mcp/client.go:24-27. There is no data, mimeType, resource or annotations, and CallToolResult (:29-32) has no structuredContent. TextContent (:443-451) keeps only blocks where Type == "text" and drops everything else.

So a server returning an image, audio, an embedded resource, or structured content produces (empty MCP tool result). Browser and screenshot MCP servers are the common case: the tool call succeeds, the server returns a perfectly good image, and the model is told nothing came back. It then usually retries, which is the worst outcome.

Two parts, and the first is worth doing alone:

  1. Stop silently dropping. If a result contains only non-text blocks, say what they were (returned 1 image/png block, which Zero cannot yet forward) instead of reporting empty. Prevents the retry loop even before we can carry the payload.
  2. Carry image blocks through. We already have the plumbing: zeroruntime.ImageBlock and Message.Images, plus normalisation in internal/imageinput. This is gated on tool results having an image channel at all, which is a separate issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions