Skip to content

fix: model content annotations as nested objects#242

Closed
LucaButBoring wants to merge 5 commits intomodelcontextprotocol:mainfrom
LucaButBoring:fix/content-annotations
Closed

fix: model content annotations as nested objects#242
LucaButBoring wants to merge 5 commits intomodelcontextprotocol:mainfrom
LucaButBoring:fix/content-annotations

Conversation

@LucaButBoring
Copy link
Copy Markdown
Contributor

@LucaButBoring LucaButBoring commented May 16, 2025

Updates all Content types to represent annotations as nested objects instead of directly on the content itself. The existing ctors have been moved to deprecated shim ctors for backwards-compat.

This brings the implementation in line with the content types as modeled by the specification. An integration test has been added to ensure this doesn't drift in the future.

Motivation and Context

Content annotations have been incorrect for at least six months. The integration test added in this PR fails without the related schema changes.

How Has This Been Tested?

Newly-implemented integration test, leveraging the appropriate tool from everything.

Breaking Changes

None; the old constructor has been maintained for backwards-compatibility purposes. The old auto-generated record properties (.audience() and .priority()) have also been maintained.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/mcp-schema waiting for user Waiting for user feedback or more details

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants