-
Notifications
You must be signed in to change notification settings - Fork 352
Update content according to latest spec #513
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?
Conversation
7fb9021
to
c3b9a7f
Compare
134ef87
to
33e438e
Compare
@halter73, @eiriktsarpalis, I've updated this with the most recent updates to the spec. |
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 pull request updates the SDK to conform to the latest protocol specification changes. Key updates include renaming response and notification types (e.g., CallToolResponse to CallToolResult, CancelledNotification to CancelledNotificationParams) and adding new properties such as LastModified in annotations.
Reviewed Changes
Copilot reviewed 106 out of 106 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
src/ModelContextProtocol.Core/Protocol/CallToolRequestParams.cs | Updated documentation references to the new CallToolResult type. |
src/ModelContextProtocol.Core/Protocol/Annotations.cs | Added a new LastModified property with ISO 8601 guidelines. |
src/ModelContextProtocol.Core/McpSession.cs | Adjusted usage of cancellation and notification parameter types. |
src/ModelContextProtocol.Core/McpJsonUtilities.cs | Updated JSON serialization context types to reflect spec changes. |
src/ModelContextProtocol.Core/Client/McpClientTool.cs | Changed method signatures and usages from CallToolResponse to CallToolResult and added a Title property. |
src/ModelContextProtocol.Core/Client/McpClientExtensions.cs | Refactored LINQ expressions and adjusted parameter types in line with the new spec. |
src/ModelContextProtocol.Core/Client/McpClient.cs | Made similar type updates and improved handling of notifications. |
src/ModelContextProtocol.Core/AIContentExtensions.cs | Updated conversion methods from Content to ContentBlock and applied new switch expressions. |
samples/* | Updated sample tools and program logic to reference the new types and properties. |
Comments suppressed due to low confidence (2)
samples/TestServerWithHosting/Tools/SampleLlmTool.cs:23
- [nitpick] Consider adding a fallback value (e.g., using the null-coalescing operator) to ensure a non-null output in case the cast to TextContentBlock fails.
return "LLM sampling result: " + (sampleResult.Content as TextContentBlock)?.Text;
samples/EverythingServer/Tools/SampleLlmTool.cs:20
- [nitpick] Consider adding a fallback value (e.g., using the null-coalescing operator) to ensure a non-null string is returned if the cast to TextContentBlock fails.
return "LLM sampling result: " + (sampleResult.Content as TextContentBlock)?.Text;
Closes #508
Closes #517
Closes #518