-
Notifications
You must be signed in to change notification settings - Fork 386
Fix:Missing Structured Content for Virtual Server in Streamable HTTP Response #1412
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: rakdutta <[email protected]>
Signed-off-by: rakdutta <[email protected]>
Signed-off-by: rakdutta <[email protected]>
Signed-off-by: rakdutta <[email protected]>
Signed-off-by: rakdutta <[email protected]>
Signed-off-by: rakdutta <[email protected]>
Signed-off-by: rakdutta <[email protected]>
Signed-off-by: rakdutta <[email protected]>
Signed-off-by: rakdutta <[email protected]>
Signed-off-by: rakdutta <[email protected]>
Signed-off-by: rakdutta <[email protected]>
Signed-off-by: rakdutta <[email protected]>
kevalmahajan
approved these changes
Nov 12, 2025
Member
kevalmahajan
left a comment
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.
Structured Content is properly generated now with both /mcp as well as /sse and is being validated with the defined OutputSchema for the tool on the mcp client side.
- Change verbose info logging to debug level for tool responses to reduce production log noise while maintaining debug capability - Remove redundant isinstance check in plugin response handling - Add comprehensive docstring explaining structured content return types and MCP SDK behavior in call_tool function - Add test case for structured content validation with tuple returns - Improve code maintainability and documentation clarity These changes enhance code quality without altering functionality, improving pylint score from 9.64 to 9.77. Signed-off-by: Mihai Criveti <[email protected]>
d8c0937 to
e6deb8e
Compare
crivetimihai
approved these changes
Nov 12, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
closing issue #1406
This pull request introduces improvements to the handling and processing of tool responses, particularly for structured content, and enhances logging for debugging and traceability. The changes ensure that both unstructured and structured outputs from tools are correctly normalized and returned, and that the code is robust against different field naming conventions and model types.
Tool response handling and normalization:
call_toolinstreamablehttp_transport.pyto return both unstructured and structured content when available, supporting both snake_case and camelCase field names for structured content. This allows downstream validation against output schemas.tool_service.py, enhanced extraction of structured content from tool responses by accepting bothstructuredContentandstructured_contentfields, improving compatibility with different model serialization formats.Unit test robustness:
test_streamablehttp_transport.pyto explicitly unsetstructured_contentand overridemodel_dumpon mocks, preventing accidental attribute leakage and ensuring test accuracy.