No support for tool outputSchema (MCP spec 2025-06-18)

Open
#103 1 comment 0 reactions 0 assignees View on GitHub

@alesanGreat is already working on this.

Since Aug 28, 2026.

  • #127 by @alesanGreat — open

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
55/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Quiet
Tech stack
r
Domain
api

Research direction

Start by checking how ellmer::tool() stores definitions in ToolDef and how mcptools::tool_as_json() serializes them. Confirm the upstream ellmer change is available, then trace the tools/list output path. Done means a declared outputSchema is preserved and emitted in the expected JSON structure.

Written by the indexing model from the issue text.

Description

Problem

The MCP spec (2025-06-18) defines an outputSchema field on tool definitions — a JSON Schema describing the expected structure of tool results. This enables clients to validate outputs and provides type information for better integration.

Neither tool_as_json() nor ellmer::tool() currently support declaring an output schema.

Expected

ellmer::tool(
  fun = function() list(auc = 0.92, tss = 0.81),
  name = "evaluate_model",
  description = "Evaluate model performance",
  arguments = list(),
  outputSchema = list(
    type = "object",
    properties = list(
      auc = list(type = "number"),
      tss = list(type = "number")
    ),
    required = c("auc", "tss")
  )
)

Should produce in tools/list:

{
  "name": "evaluate_model",
  "description": "Evaluate model performance",
  "inputSchema": {...},
  "outputSchema": {
    "type": "object",
    "properties": {
      "auc": {"type": "number"},
      "tss": {"type": "number"}
    },
    "required": ["auc", "tss"]
  }
}

Use Case

Building an SDM MCP server with ~70 tools. Each tool returns structured data (metrics, file paths, statistics). outputSchema would let clients validate every tool response automatically instead of parsing free-form text.

Fix

  1. Add outputSchema parameter to ellmer::tool() (stores on ToolDef)
  2. Include in tool_as_json() output in mcptools

Depends on ellmer changes first, then mcptools serialization.

Dominant language
R
Stars
207
Forks
24
Avg merge
36m
Merged PRs (30d)
2

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from posit-dev/mcptools

All issues in posit-dev/mcptools

Similar issues

More R issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.