Skip to content

Spring AI + MCP: can a tool return an image (media) to the LLM? #75

@RomanSkochko

Description

@RomanSkochko

We’re building a Spring Boot app that uses Spring AI as an MCP client and a Spring MCP server, and we need a tool that can return a real file—starting with images (png/jpg)—so the LLM can actually see and analyze it.

Right now the tool returns JSON with a presigned S3 URL; the model treats it as plain text, echoes the link, and often says it can’t read the file, so the response is just a URL instead of an analysis/description of the image.

Advice is welcome, thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions