generated from amazon-archives/__template_Apache-2.0
-
Notifications
You must be signed in to change notification settings - Fork 507
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Checks
- I have updated to the lastest minor and patch version of Strands
- I have checked the documentation and this is not expected behavior
- I have searched ./issues and there are no duplicates of my issue
Strands Version
1.16.0
Python Version
3.11
Operating System
Linux
Installation Method
pip
Steps to Reproduce
When loading tools via the MCP client, the tool normalization steps cause tool use errors when the inputSchema includes more complex data types (e.g. List[str], List[Model], etc.).
- The MCP server will describe this property using
anyOf(e.g. forList[str] | None, one will see"anyOf": [{"items": {"type": "string"},"type": "array"},{"type": "null"}]) - When the
MCPClientnormalizes the tools, in the_normalize_propertyfunction, it sets the defaulttypetostring - This causes the model to return string encoded json data to the tool (e.g.
'["foo", "bar"]'leading to tool input validation errors
Looking at this line, to fix this issue, I would suggest checking not "anyOf" in prop_def before setting the default type. If anyOf is present, omit a default type value.
Expected Behavior
The tool inputSchema should not set type="string" for properties defined using anyOf.
Actual Behavior
The tool inputSchema is being setdefault to type="string" when it should be omitted.
Additional Context
No response
Possible Solution
No response
Related Issues
No response
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working