Skip to content

Handling image data from MCP servers #91

Open
@MoNorth

Description

@MoNorth

Please read this first

  • Have you read the docs? Agents SDK docs
  • Have you searched for related issues? Others may have faced similar issues.

Describe the bug

The image returned by MCP cannot be recognized by LLM, and the result returned by function call cannot be recognized if it is an image. Can you provide a hook that can rewrite the return result of the function call so that it can be recognized by LLM.

[
    {
        "type": "image",
        "data": "xxxx(base64)",
        "mimeType": "image/jpeg"
    }
]

Debug information

  • Agents SDK version: (e.g. v0.0.5)
  • Runtime environment (e.g. Node.js 22.16.0)

Repro steps

Ideally provide a minimal JavaScript/TypeScript script that can be run to reproduce the bug.

Expected behavior

A clear and concise description of what you expected to happen.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions