Skip to content

Support structureOutput from MCP server tools #468

@akhromow

Description

@akhromow

MCP server callTool function only returns the content field of a tool call response.
This creates a limitation: if an MCP tool returns only structuredOutput, an agent ends up receiving an empty array as the result.

const parsed = CallToolResultSchema.parse(response);
const result = parsed.content; // structuredOutput is ignored

This feature is being implemented already in python sdk, as use_structured_content parameter on MCPServer class.

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