feat!: type Annotations.lastModified as a string#956
Open
DaleSeo wants to merge 1 commit into
Open
Conversation
13d6cd3 to
df19f3d
Compare
df19f3d to
22243e3
Compare
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.
Motivation and Context
The MCP 2025-11-25 schema types
Annotations.lastModifiedas a plain string. Some schema-valid values, such as date-only strings or offset-less date-times, are not strict RFC 3339 and could previously cause a whole message to fail deserialization when nested in content or resource annotations.This PR changes
Annotations.last_modifiedto preservelastModifiedas the schema-defined string instead of eagerly parsing it asDateTime<Utc>. The DateTime-based writer helpers still acceptDateTime<Utc>and serialize RFC 3339 strings, while callers that need a typed read can uselast_modified_datetime().This is also consistent with
Task.createdAtandTask.lastUpdatedAt, which are already represented as strings in rmcp. Keeping the raw string is lossless for proxying and forwarding, while the new accessor keeps DateTime ergonomics for callers that want best-effort typed parsing.How Has This Been Tested?
Added tests
Breaking Changes
Yes. The public field
Annotations.last_modifiedchanges type fromOption<DateTime<Utc>>toOption<String>.The public API / SemVer check is expected to flag this field-type change. That is intentional for the v3 release.
Types of changes
Checklist