Skip to content

Allow JSON-value structured tool output#208

Closed
leehack wants to merge 1 commit into
spec/2026-client-subscriptions-listenfrom
spec/2026-json-schema-structured-content
Closed

Allow JSON-value structured tool output#208
leehack wants to merge 1 commit into
spec/2026-client-subscriptions-listenfrom
spec/2026-json-schema-structured-content

Conversation

@leehack
Copy link
Copy Markdown
Owner

@leehack leehack commented May 31, 2026

Summary

  • allow MCP 2026 tool outputSchema to use any JSON Schema while preserving object-root inputSchema enforcement
  • allow CallToolResult and sampling tool_result structuredContent to carry any JSON value, including explicit null
  • keep stable 2025 callers compatible by omitting non-object output schemas and non-object structuredContent from stable server responses

Validation

  • dart format .
  • dart analyze
  • dart test test/tool_schema_test.dart test/types/sampling_test.dart test/client/client_tool_validation_test.dart test/server/output_validation_test.dart
  • dart test
  • git diff --check
  • (packages/mcp_dart_cli) dart analyze
  • (packages/mcp_dart_cli) dart test
  • (packages/mcp_dart_cli) dart run bin/mcp_dart.dart conformance --suite all --json

@codecov
Copy link
Copy Markdown

codecov Bot commented May 31, 2026

Codecov Report

❌ Patch coverage is 92.85714% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.95%. Comparing base (e867775) to head (9245893).

Files with missing lines Patch % Lines
lib/src/types/validation.dart 81.25% 3 Missing ⚠️
lib/src/server/mcp_server.dart 95.83% 1 Missing ⚠️
Additional details and impacted files
@@                            Coverage Diff                            @@
##           spec/2026-client-subscriptions-listen     #208      +/-   ##
=========================================================================
+ Coverage                                  87.94%   87.95%   +0.01%     
=========================================================================
  Files                                         47       47              
  Lines                                       8957     9002      +45     
=========================================================================
+ Hits                                        7877     7918      +41     
- Misses                                      1080     1084       +4     
Flag Coverage Δ
unittests 87.95% <92.85%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 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.

@leehack
Copy link
Copy Markdown
Owner Author

leehack commented Jun 1, 2026

Closing this draft micro PR because the RC spec work has been consolidated into a smaller reviewable stack. This change is preserved in #268 (MCP 2026 transport enforcement); the consolidated tip is tree-identical to the previous micro-stack tip.

@leehack leehack closed this Jun 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant