-
Couldn't load subscription status.
- Fork 453
feat: add optional outputSchema support for tool specifications #818
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
feat: add optional outputSchema support for tool specifications #818
Conversation
|
Thanks for the work here! |
c020b6b to
b31dc7d
Compare
b31dc7d to
5470b11
Compare
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.
Should we add outputSchema here too: https://github.com/strands-agents/sdk-python/blob/main/src/strands/tools/mcp/mcp_agent_tool.py#L63
- Add outputSchema as optional field in ToolSpec using NotRequired - Filter outputSchema unconditionally in streaming.py before passing to models - Add outputSchema support to MCP agent tool adapter - Add tests for outputSchema functionality - Addresses PR strands-agents#818 review comments
5470b11 to
49c0897
Compare
yes, thanks for pointing it out. |
|
Hi, I want to apologize for the delay in reviewing this. I will take a look tomorrow morning with the aim of getting the PR merged next week. |
Thanks! |
49c0897 to
169fca4
Compare
- Add outputSchema as optional field in ToolSpec using NotRequired - Filter outputSchema unconditionally in streaming.py before passing to models - Add outputSchema support to MCP agent tool adapter - Add tests for outputSchema functionality - Addresses PR strands-agents#818 review comments
- Add outputSchema as optional field in ToolSpec using NotRequired - Filter outputSchema unconditionally in streaming.py before passing to models - Add outputSchema support to MCP agent tool adapter - Add tests for outputSchema functionality - Addresses PR strands-agents#818 review comments
f6fcbd3 to
c0a6d5e
Compare
|
@dbschmigelski Hi,any issues for this merge? |
- Add outputSchema as optional field in ToolSpec using NotRequired - Filter outputSchema unconditionally in streaming.py before passing to models - Add outputSchema support to MCP agent tool adapter - Add tests for outputSchema functionality - Addresses PR strands-agents#818 review comments
c0a6d5e to
5eef756
Compare
|
Hi, turns out #836 was not as relevant. Or rather it did not go far enough. We still were coupled to the ToolSpec definition. This PR removes that by doing the destructuring in BedrockModel. Meaning we do not need the global filter in the event loop. All other providers drop the additional field. |
- Add outputSchema as optional field in ToolSpec using NotRequired - Filter outputSchema unconditionally in streaming.py before passing to models - Add outputSchema support to MCP agent tool adapter - Add tests for outputSchema functionality - Addresses PR strands-agents#818 review comments
03bbe72 to
afeeaf5
Compare
This PR adds support for MCP output schema tool specifications as defined in the MCP specification (https://modelcontextprotocol.io/specification/2025-06-18/server/tools#data-types). This allows tools to define their expected output structure through outputSchema, which is particularly valuable for LLM agents to better understand tool capabilities and responses.
Note, the LLM is not automatically shown the outputSchema. In the future certain models may accept but. But for now, it is a device that users can leverage internally. For example if someone wanted to create their own dynamic tool loader they could use the outputSchema as a message.
As part of this we needed to make sure the BedrockModel explicitly manages its supported fields (including handling outputSchema appropriately), while other providers naturally drop fields they don't recognize. This maintains backward compatibility while keeping the code cleaner and more maintainable.
Closes #787
Type of Change
New feature
Testing
How have you tested the change? Verify that the changes do not break functionality or introduce warnings in consuming repositories: agents-docs, agents-tools, agents-cli
hatch run prepareChecklist
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.