Skip to content

Validate discovery result types#254

Closed
leehack wants to merge 1 commit into
spec/elicit-request-task-compatfrom
spec/discover-result-type-validation
Closed

Validate discovery result types#254
leehack wants to merge 1 commit into
spec/elicit-request-task-compatfrom
spec/discover-result-type-validation

Conversation

@leehack

@leehack leehack commented Jun 1, 2026

Copy link
Copy Markdown
Owner

Summary

  • require server/discover results to include resultType: complete
  • reject missing, non-string, and non-complete discovery result discriminators
  • add the same rule to the built-in CLI spec conformance suite

Spec context

The MCP 2026 draft DiscoverResult schema requires resultType, and the only valid complete discovery response shape uses resultType: "complete". server/discover is draft-only in this SDK, so this tightens that typed boundary without changing stable initialization behavior.

Part of #177.

Tests

  • dart format lib/src/types/initialization.dart test/mcp_2026_07_28_test.dart packages/mcp_dart_cli/lib/src/conformance_runner.dart packages/mcp_dart_cli/test/src/conformance_command_test.dart
  • dart test test/mcp_2026_07_28_test.dart
  • dart pub get in packages/mcp_dart_cli
  • dart test test/src/conformance_command_test.dart in packages/mcp_dart_cli
  • dart analyze
  • dart analyze in packages/mcp_dart_cli
  • git diff --check
  • dart test
  • dart test in packages/mcp_dart_cli

@codecov

codecov Bot commented Jun 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.49%. Comparing base (703a7dc) to head (fbff7e0).

Additional details and impacted files
@@                       Coverage Diff                        @@
##           spec/elicit-request-task-compat     #254   +/-   ##
================================================================
  Coverage                            88.49%   88.49%           
================================================================
  Files                                   47       47           
  Lines                                 9358     9363    +5     
================================================================
+ Hits                                  8281     8286    +5     
  Misses                                1077     1077           
Flag Coverage Δ
unittests 88.49% <100.00%> (+<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 leehack force-pushed the spec/discover-result-type-validation branch from b03beeb to fbff7e0 Compare June 1, 2026 08:14
@leehack

leehack commented Jun 1, 2026

Copy link
Copy Markdown
Owner Author

Closing this draft micro PR because the RC spec work has been consolidated into a smaller reviewable stack. This change is preserved in #271 (type/schema validation); 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