Skip to content

Conversation

@rakdutta
Copy link
Collaborator

@rakdutta rakdutta commented Nov 10, 2025

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:

  • Updated call_tool in streamablehttp_transport.py to 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.
  • In tool_service.py, enhanced extraction of structured content from tool responses by accepting both structuredContent and structured_content fields, improving compatibility with different model serialization formats.

Unit test robustness:

  • Updated unit tests in test_streamablehttp_transport.py to explicitly unset structured_content and override model_dump on mocks, preventing accidental attribute leakage and ensuring test accuracy.

Signed-off-by: rakdutta <rakhibiswas@yahoo.com>
Signed-off-by: rakdutta <rakhibiswas@yahoo.com>
Signed-off-by: rakdutta <rakhibiswas@yahoo.com>
Signed-off-by: rakdutta <rakhibiswas@yahoo.com>
Signed-off-by: rakdutta <rakhibiswas@yahoo.com>
Signed-off-by: rakdutta <rakhibiswas@yahoo.com>
Signed-off-by: rakdutta <rakhibiswas@yahoo.com>
Signed-off-by: rakdutta <rakhibiswas@yahoo.com>
Signed-off-by: rakdutta <rakhibiswas@yahoo.com>
Signed-off-by: rakdutta <rakhibiswas@yahoo.com>
@rakdutta rakdutta marked this pull request as ready for review November 10, 2025 15:49
Signed-off-by: rakdutta <rakhibiswas@yahoo.com>
Signed-off-by: rakdutta <rakhibiswas@yahoo.com>
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.

2 participants