Skip to content

Conversation

@koic
Copy link
Member

@koic koic commented May 31, 2025

Motivation and Context

This change is related to #29.

According to the specification, both description and mimeType of Resource are optional: https://modelcontextprotocol.io/specification/2025-03-26/server/resources#resource

Therefore, it makes sense to treat them as optional keyword arguments, similar to how this is done in ResourceTemplate: https://github.com/modelcontextprotocol/ruby-sdk/blob/0b49c3/lib/mcp/resource_template.rb#L8

As additional context, the TypeScript SDK also treats them as optional. https://github.com/modelcontextprotocol/typescript-sdk/blob/1.12.1/src/types.ts#L438-L466

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

…ource`

This change is related to modelcontextprotocol#29.

According to the specification, both `description` and `mimeType` of Resource are optional:
https://modelcontextprotocol.io/specification/2025-03-26/server/resources#resource

Therefore, it makes sense to treat them as optional keyword arguments,
similar to how this is done in `ResourceTemplate`:
https://github.com/modelcontextprotocol/ruby-sdk/blob/0b49c3/lib/mcp/resource_template.rb#L8

As additional context, the TypeScript SDK also treats them as optional.
https://github.com/modelcontextprotocol/typescript-sdk/blob/1.12.1/src/types.ts#L438-L466
@atesgoral atesgoral merged commit 8d88156 into modelcontextprotocol:main May 31, 2025
5 checks passed
@koic koic deleted the make_some_optional_kwargs_in_resource branch May 31, 2025 17:43
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.

2 participants