Skip to content

Conversation

@michaelneale
Copy link
Contributor

@michaelneale michaelneale commented Aug 7, 2025

This is a very small fix for issue: #355

MCP servers (especially in python) will likely fail with 0.4.0 with an error like "Error: Unexpected response type"
this is due to the validation content and structured_content are mutually exclusive, but this is a bit strict.

How Has This Been Tested?

Tested with goose and a python based MCP server - it worked with < 0.4.0 and failed with 0.4.0.
I then tested this patch with the goose agent and exactly the same server it works.

Breaking Changes

None

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

alexhancock
alexhancock previously approved these changes Aug 7, 2025
@michaelneale
Copy link
Contributor Author

@alexhancock PTAL again - not sure about the comment lint check though

@michaelneale michaelneale force-pushed the micn/structured_content_fix branch from b83bc36 to 7f33cdf Compare August 7, 2025 03:47
@michaelneale michaelneale changed the title fix: allow backwards compat as per MCP spec fix(model): allow backwards compat as per MCP spec Aug 7, 2025
assert_eq!(result.is_error, Some(true));
}

#[tokio::test]

Choose a reason for hiding this comment

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

maybe keep the test and check that it it doesn't error at the end?

Copy link

@crepererum crepererum left a comment

Choose a reason for hiding this comment

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

GitHub doesn't let me comment outside the diff, but I think the CallToolResult struct docstring needs adjustment. The last line needs to be removed:

///
/// Note: `content` and `structured_content` are mutually exclusive - exactly one must be provided.

@alexhancock
Copy link
Collaborator

@crepererum I addressed the feedback in #359 - not pushing to this one since it's @michaelneale's fork and I won't have access

@alexhancock
Copy link
Collaborator

Merged #359 which has these changes!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

T-core Core library changes T-test Testing related changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants