Skip to content

fix: interpretation of unstructured content and tests #602

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

Conversation

kentcdodds
Copy link
Contributor

Motivation and Context

Update structured output validation to align with spec allowing multiple unstructured content blocks.

Previously, the inspector incorrectly validated that unstructured output must contain only a single text block with JSON matching the structured output. This PR updates the validation to correctly reflect the spec, which allows unstructured output to include a JSON text block matching the structured output, alongside any number of other content blocks (text, image, linked/embedded resources, etc.) in any order, as clarified in modelcontextprotocol/modelcontextprotocol#889.

How Has This Been Tested?

Ran it locally with my own MCP server:

image image

Also, the tests have been updated and are passing.

Breaking Changes

No.

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

This was written by Cursor Agents, but reviewed and run by me.

@kentcdodds kentcdodds changed the title Cursor/fix pull request interpretation and tests 7a8f fix: interpretation of unstructured content and tests Jul 10, 2025
Copy link
Contributor

@bhosmer-ant bhosmer-ant left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you!

@bhosmer-ant bhosmer-ant merged commit 3acc6d8 into modelcontextprotocol:main Jul 11, 2025
5 checks passed
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.

3 participants