Skip to content

Add support for tool structured content and output schema #146

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 1 commit into
base: main
Choose a base branch
from

Conversation

ptitjes
Copy link
Contributor

@ptitjes ptitjes commented Jul 11, 2025

Fixes #139

In this PR, I add:

  • structuredContent in CallToolResult
  • outputSchema in Tool
  • extends the ToolSerializationTest
  • added an additional Server.addTool() taking a tool directly, to make it more consistent with addPrompt methods

Motivation and Context

To support the new tool structured output and output schema of the 2025-06-18 protocol version.

How Has This Been Tested?

I extended the existing ToolSerializationTest to verify that the output schema was correctly serialized.

Breaking Changes

Note that I added the outputSchema field in the Tool data class before the new annotations field added on July, the 7th. I considered that there had not been any release since the addition of annotations, so it would not break the compatibility of the componentX() data class methods for the SDK users.

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

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.

Support tool structured content and output schema
1 participant