-
Notifications
You must be signed in to change notification settings - Fork 155
158 support resource links #244
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
base: main
Are you sure you want to change the base?
158 support resource links #244
Conversation
23d2726
to
c3746a4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for ResourceLink ContentBlock type to align with the MCP specification, refactoring the existing PromptMessageContent type hierarchy to use the more structured ContentBlock interface.
- Introduces ResourceLink as a new ContentBlock type for linking to external resources
- Refactors type hierarchy from PromptMessageContent to ContentBlock with specialized content types
- Maintains backwards compatibility by deprecating old interfaces while keeping them functional
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
kotlin-sdk-core/src/commonMain/kotlin/io/modelcontextprotocol/kotlin/sdk/types.kt | Adds ResourceLink class and ContentBlock interface hierarchy |
kotlin-sdk-core/src/commonMain/kotlin/io/modelcontextprotocol/kotlin/sdk/types.util.kt | Updates polymorphic serializers for new ContentBlock types |
kotlin-sdk-core/src/commonTest/kotlin/io/modelcontextprotocol/kotlin/sdk/TypesTest.kt | Adds tests for ResourceLink and updates existing tests |
kotlin-sdk-core/src/commonTest/kotlin/io/modelcontextprotocol/kotlin/sdk/TypesUtilTest.kt | Updates serialization tests for ContentBlock types |
kotlin-sdk-core/api/kotlin-sdk-core.api | API documentation for new types and interfaces |
CONTRIBUTING.md | Minor update to build instructions |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Support resource links in tool result content #158
Motivation and Context
The new spec introduced a new
ContentBlock
type:ResourceLink
. This type however hasn't been implemented yet.Noticed that there was actually no
ContentBlock
type at all in the core as the latest schema reference specified. Instead there is aPromptMessageContent
.How Has This Been Tested?
Added unit tests. Ran all tests.
Also used the build in a standalone project:
Breaking Changes
Added the following:
ContentBlock
CreateMessageResultContent
, andSamplingMessageContent
However, I kept the two intrefaces
PromptMessageContent
andPromptMessageContentMultimodal
purely for backwards compatibility. They are deprecated however.Types of changes
Checklist
Additional context