Skip to content

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

stephentoub
Copy link
Contributor

@stephentoub stephentoub commented Jun 12, 2025

Closes #508
Closes #517
Closes #518

Copilot

This comment was marked as outdated.

@stephentoub stephentoub force-pushed the contentsupport branch 3 times, most recently from 7fb9021 to c3b9a7f Compare June 12, 2025 21:07
@stephentoub stephentoub requested a review from Copilot June 12, 2025 21:37
Copilot

This comment was marked as outdated.

@stephentoub
Copy link
Contributor Author

@halter73, @eiriktsarpalis, I've updated this with the most recent updates to the spec.

@stephentoub stephentoub requested a review from Copilot June 14, 2025 02:24
Copy link
Contributor

@Copilot Copilot AI left a 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;

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.

feat: Adds _meta to additional interface types. #710 Encourage title properties/usage for objects/resources Add ResourceLink to CallToolResult
1 participant