claude-code - 💡(How to fix) Fix [FEATURE] Surface MCP tool outputSchema to the model context, not just the renderer [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#54197Fetched 2026-04-29 06:33:42
View on GitHub
Comments
0
Participants
1
Timeline
2
Reactions
0
Participants
Timeline (top)
labeled ×2

Root Cause

When a model uses an MCP tool for the first time, it has no way to know what shape will come back. The schema is on the wire, the harness has parsed it, the validator uses it server-side — but the model itself has to discover the response shape empirically (call once, observe, sometimes call again). For chained tool-use and structured-output workflows this adds avoidable round-trips and burns context.

structuredContent on the response side does already round-trip (the model receives the typed object, not just markdown text) — so half of MCP 2025-06-18's discoverability story works in Claude Code today. The asymmetry is just on the pre-call side.

Code Example

{ name, description, parameters }   // parameters = inputSchema
RAW_BUFFERClick to expand / collapse

What

MCP servers can declare a per-tool outputSchema in tools/list (introduced in spec 2025-06-18, PR modelcontextprotocol#371). Claude Code reads this — it's used internally for renderer validation of tool_use_result (visible via the safeParse flow that triggered #41361) — but it is not included in the tool catalog presented to the model.

The model receives only:

{ name, description, parameters }   // parameters = inputSchema

outputSchema is dropped before reaching the model.

Why this matters

When a model uses an MCP tool for the first time, it has no way to know what shape will come back. The schema is on the wire, the harness has parsed it, the validator uses it server-side — but the model itself has to discover the response shape empirically (call once, observe, sometimes call again). For chained tool-use and structured-output workflows this adds avoidable round-trips and burns context.

structuredContent on the response side does already round-trip (the model receives the typed object, not just markdown text) — so half of MCP 2025-06-18's discoverability story works in Claude Code today. The asymmetry is just on the pre-call side.

Repro

Any MCP server emitting outputSchema. Confirmed by tools/list wire capture (outputSchema present) plus an in-session prompt asking the model to print the literal outputSchema for a registered tool — the model reports it sees only parameters, no outputSchema.

Ask

Include outputSchema (raw, or as a synthesized compact prose summary appended to description) in the tool catalog passed to the model alongside each tool's name, description, and parameters.

Spec posture

This is permitted-but-not-required: the 2025-06-18 spec uses MUST only for the server-side emission and SHOULD only for client-side validation. The "helps … LLMs … properly parse and utilize the returned data" line is advisory benefit, not a conformance clause. So Claude Code is spec-compliant today — filing as a feature request, not a bug.

Ecosystem precedent

Adjacent issues seen during search (not duplicates of this ask)

  • #41361 — renderer regression on outputSchema mismatch (different surface)
  • #25081 — earlier servers-getting-dropped issue, fixed
  • #4427, #14465, #15412, #24742 — all about structuredContent plumbing on the result side

None ask for surfacing outputSchema in the model-facing catalog.

extent analysis

TL;DR

Include the outputSchema in the tool catalog passed to the model to improve discoverability and reduce round-trips.

Guidance

  • Review the MCP server's tools/list response to confirm that outputSchema is being emitted.
  • Modify the tool catalog generation to include outputSchema alongside name, description, and parameters for each tool.
  • Consider appending a compact prose summary of outputSchema to the description field as an alternative to including the raw schema.
  • Verify that the model receives the updated tool catalog with outputSchema by checking the model's output or using a debugging tool.

Example

No code snippet is provided as the issue does not contain specific code references.

Notes

The MCP spec permits but does not require the inclusion of outputSchema in the tool catalog, so this change is a feature request rather than a bug fix.

Recommendation

Apply a workaround by including outputSchema in the tool catalog, as this will improve the model's ability to discover and utilize the returned data without requiring a spec change.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [FEATURE] Surface MCP tool outputSchema to the model context, not just the renderer [1 participants]