Skip to content

fix(mcp): describe dynamic outputs with explicit schemas - #1626

Merged
monkeyWie merged 1 commit into
mainfrom
codex/fix-mcp-output-schema
Oct 28, 2026
Merged

monkeyWie merged 1 commit into
mainfrom
codex/fix-mcp-output-schema

Conversation

@monkeyWie

@monkeyWie monkeyWie commented Oct 28, 2026 •

Copy link
Copy Markdown
Member

Boolean property schemas inferred from any make some MCP clients reject the entire tools/list response. Keep the existing Go types and JSON payloads, but provide explicit output schemas for get_task_stats, get_task, and resolve_task.

  • Describe dynamic values with object-form anyOf branches covering all JSON types, including null. This preserves protocol-specific statistics, restored snapshots, and extension-defined metadata without imposing download-input restrictions on outputs.
  • Cover nested request/option extra fields, including requests inside resource files, as well as get_task_stats.stats.
  • Allow null request labels, matching how nil maps serialize.

Validation:

  • go test ./pkg/mcpserver ./pkg/rest passes, including actual Streamable HTTP calls to the affected tools and REST integration tests.
  • A regression test checks property schemas in the serialized input/output definitions of every tool. Removing the explicit output-schema bindings reproduces failures at all five affected paths across the three tools.
  • Output validation covers HTTP/BT/ED2K statistics, restored HLS snapshots, null values, extension extras, and invalid output envelopes.

Fixes #1625

@codecov

codecov Bot commented Oct 28, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.73684% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.75%. Comparing base (91edba9) to head (2b8de26).

Files with missing lines Patch % Lines
pkg/mcpserver/server.go 94.73% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1626      +/-   ##
==========================================
+ Coverage   72.40%   72.75%   +0.34%     
==========================================
  Files         102      102              
  Lines       15697    15722      +25     
==========================================
+ Hits        11366    11438      +72     
+ Misses       3100     3044      -56     
- Partials     1231     1240       +9     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@monkeyWie monkeyWie added the bug Something isn't working label Oct 28, 2026
@monkeyWie
monkeyWie merged commit be0fb05 into main Oct 28, 2026
16 checks passed
@monkeyWie
monkeyWie deleted the codex/fix-mcp-output-schema branch October 28, 2026 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] MCP tools/list returns a boolean JSON Schema for get_task_stats, breaking strict clients

1 participant