Skip to content

Pass custom content types in call_tool_chain result #5

@RomaRogov

Description

@RomaRogov

I'm working with MCP Servers for game engines right now (Cocos Creator, Unity) and your project looks very promising for improving functionality of agents in this field, thank you for you work!
Although, sometimes I need to pass preview as an image to MCP tool result. Looking at MCP Communication protocol I can see that tool result is processed as an object/value if it has "text" type, otherwise - passed as it is.
So, when I'm passing "image" type in response content, I will get an object that looks like this:

{
  type: "image",
  data: BASE64_IMAGE_DATA,
  mimeType: "image/jpeg",
}

The problem is call_tool_chain tool, as I see here, always perform JSON.stringify on the result and returns "text" type as MCP tool response.

Can you please handle different result types at this point and add it to resulting content as it is?

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