Skip to content

MCP tool can no longer return image attachments #32832

@psemeniuk

Description

@psemeniuk

Description

Regression where MCP tool results containing an image are no longer preserved/rendered correctly.

I reproduced this with a minimal standalone local MCP server whose tool returns a single tiny PNG image and no text.

1.17.4 works.

1.17.5+ is broken.

In the broken versions, the image is dropped before the model sees it. The model only receives/mentions a JSON success indicator like {"ok":true} instead of an actual image.

Plugins

none

OpenCode version

1.17.5

Steps to reproduce

  1. Create a local MCP server with one tool, for example image_only_result.
  2. Make that tool return a tool result with a single inline PNG image and no text:
{
  "content": [
    {
      "type": "image",
      "data": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAADElEQVR4nGP4z8AAAAMBAQDJ/pLvAAAAAElFTkSuQmCC",
      "mimeType": "image/png"
    }
  ],
  "structuredContent": { "ok": true },
  "isError": false
}
  1. Create a minimal agent/command that calls the tool exactly once and then reports whether it can see an image.
  2. Run it with opencode 1.17.4 and then with opencode 1.17.5.

Expected:

  • the tool result keeps its image attachment
  • the model can see the image

Actual on 1.17.5+:

  • the tool result is collapsed to text/structured output
  • no image attachment is preserved
  • the model reports that it cannot see an actual image

Concrete result from my minimal repro:

  • 1.17.4: model response said it could see a tiny PNG image
  • 1.17.5+: model response said it only saw text/metadata / {"ok":true}

Screenshot and/or share link

No public share link. I can provide the minimal repro files if needed.

Operating System

macOS 26.5.1 arm64

Terminal

Ghostty

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions