Skip to content

feat: implement audio content #243

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

LucaButBoring
Copy link
Contributor

Implements the AudioContent type as defined by the spec.

Motivation and Context

Adds a missing data type from the most recent specification version.

How Has This Been Tested?

Added unit tests.

Breaking Changes

None.

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

Content annotations have been implemented as described in #242 (this PR does not depend on that one). The way annotations are implemented in this PR is correct, but inconsistent with how annotations were defined on other Content subtypes with the expectation that #242 will eventually be merged.

@tzolov tzolov self-assigned this Jun 15, 2025
@tzolov tzolov added this to the 0.11.0 milestone Jun 15, 2025
tzolov pushed a commit that referenced this pull request Jun 15, 2025
- Add AudioContent record class implementing Annotated and Content interfaces
- Update Content sealed interface to permit AudioContent
- Add audio type handling in Content.type() method
- Include AudioContent in JsonSubTypes annotation for polymorphic deserialization
- Add comprehensive tests for AudioContent serialization and deserialization
- Update error message test to include audio in known type ids

https://github.com/modelcontextprotocol/modelcontextprotocol/blob/c87a0da6d8c2436d56a6398023c80b0562224454/schema/2025-03-26/schema.ts#L987-L1009
@tzolov
Copy link
Contributor

tzolov commented Jun 15, 2025

Thank you @LucaButBoring
Rebased and merged at 9a63538

@tzolov tzolov closed this Jun 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants