Skip to content

tool call result of type "image" is processed as text #2374

Description

@TheLastAncient

MCP tool returns an image in format { type: 'image', data: '<base64>', mimeType: 'image/JPEG' }

Expected result:

  • Same behavior as when a user sends an image as { type: 'image_url', image_url: '<base64>' }

Actual result:

  • base64 string gets treated as text, pushing context to +120k tokens for a single 1024x1024 jpeg image

Hacky workaround:

  • intercept tool call and store image results under assistant role, converted to image_url type.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions