Skip to content

feature:support output schema in tools #490

@koh-osug

Description

@koh-osug

Problem Statement

I get better results when an output schema is supported for tools: https://modelcontextprotocol.io/specification/2025-06-18/schema#tool

Right now it is not supported:

https://github.com/mark3labs/mcp-go/blob/main/mcp/tools.go

Proposed Solution

Add the output schema to the tools struct and process it.

MCP Spec Reference

Tool

interface Tool {
  [_meta](https://modelcontextprotocol.io/specification/2025-06-18/schema#tool-_meta)?: { [key: string]: unknown };
  [annotations](https://modelcontextprotocol.io/specification/2025-06-18/schema#tool-annotations)?: [ToolAnnotations](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations);
  [description](https://modelcontextprotocol.io/specification/2025-06-18/schema#tool-description)?: string;
  [inputSchema](https://modelcontextprotocol.io/specification/2025-06-18/schema#tool-inputschema): {
    properties?: { [key: string]: object };
    required?: string[];
    type: “object”;
  };
  [name](https://modelcontextprotocol.io/specification/2025-06-18/schema#tool-name): string;
  [outputSchema](https://modelcontextprotocol.io/specification/2025-06-18/schema#tool-outputschema)?: {
    properties?: { [key: string]: object };
    required?: string[];
    type: “object”;
  };
  [title](https://modelcontextprotocol.io/specification/2025-06-18/schema#tool-title)?: string;
}

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