Skip to content

Add MCP 2026 cacheable result hints#186

Closed
leehack wants to merge 1 commit into
spec/2026-task-extension-capabilitiesfrom
spec/2026-cacheable-results
Closed

Add MCP 2026 cacheable result hints#186
leehack wants to merge 1 commit into
spec/2026-task-extension-capabilitiesfrom
spec/2026-cacheable-results

Conversation

@leehack
Copy link
Copy Markdown
Owner

@leehack leehack commented May 31, 2026

Summary

  • add optional cacheable result fields (ttlMs/cacheScope) to tools, prompts, resources, resource templates, and resource reads
  • inject 2026 stateless server defaults for resultType, ttlMs, and cacheScope on cacheable operations while preserving legacy result JSON when hints are unset
  • cover explicit hints, legacy default serialization, negative/invalid cache metadata handling, and stateless server wire defaults

Spec context

  • MCP draft caching requires cache hints on tools/list, prompts/list, resources/list, resources/templates/list, and resources/read
  • 2026 stateless result examples use resultType: complete for completed results

Validation

  • dart format .
  • dart analyze
  • dart test test/mcp_2026_07_28_test.dart
  • dart test test/mcp_2026_07_28_test.dart test/mcp_2025_11_25_test.dart test/types/resources_test.dart test/types_test.dart test/tool_schema_test.dart test/client/client_test.dart
  • dart test -j 1
  • git diff --check

@codecov
Copy link
Copy Markdown

codecov Bot commented May 31, 2026

Codecov Report

❌ Patch coverage is 98.88889% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 86.16%. Comparing base (c9a341c) to head (5af9b80).

Files with missing lines Patch % Lines
lib/src/types/json_rpc.dart 0.00% 1 Missing ⚠️
Additional details and impacted files
@@                            Coverage Diff                            @@
##           spec/2026-task-extension-capabilities     #186      +/-   ##
=========================================================================
+ Coverage                                  86.00%   86.16%   +0.16%     
=========================================================================
  Files                                         46       46              
  Lines                                       8294     8362      +68     
=========================================================================
+ Hits                                        7133     7205      +72     
+ Misses                                      1161     1157       -4     
Flag Coverage Δ
unittests 86.16% <98.88%> (+0.16%) ⬆️

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