implementing SEP-2549#889
Open
michaelneale wants to merge 1 commit into
Open
Conversation
7175cdf to
a6151ad
Compare
a6151ad to
f8edae7
Compare
alexhancock
approved these changes
Jun 5, 2026
Contributor
alexhancock
left a comment
There was a problem hiding this comment.
Pre-approving so you can merge when the below is addressed!
The cache hints (ttlMs and cacheScope) are written to _meta, but the spec defines them as first-class result fields
Per SEP-2549, ttlMs and cacheScope are properties on the result itself (CacheableResult), so the wire shape is { "tools": [...], "ttlMs": 300000, "cacheScope": "public" } (example, L112) — not nested under _meta
Fix list:
- Top-level fields: make
ttl_ms/cache_scopereal#[serde(rename = "ttlMs"/"cacheScope")]fields on the result struct instead ofmeta.insert(...). resources/read: the same meta.insert pattern is duplicated below in ReadResourceResult, writing into each ResourceContents. The spec attaches the hints to ReadResourceResult itself, so they should live on the result (otherwise they vanish when contents is empty). Scope guidance L90.- ttlMs rules: u64 correctly blocks negatives on the producing side 👍, but there's no read-side normalization (absent → 0, negative → 0, server MUST emit >= 0). Rules L39-43.
| #[serde(rename_all = "camelCase")] | ||
| #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] | ||
| #[non_exhaustive] | ||
| pub enum CacheScope { |
Contributor
There was a problem hiding this comment.
https://modelcontextprotocol.io/seps/2549-TTL-for-list-results#cache-scope
This should have "public" and "private"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
implementing #875
(assisted by mic and goose)