Checks
Strands Version
1.3.0
Python Version
3.11.13
Operating System
Linux
Installation Method
pip
Steps to Reproduce
Create a file called multiple_tools.py with multiple unique @tool definitions
Pass tool as file path to Agent:
agent = Agent(
tools=['/tools/multiple_tools.py']
)
Expected Behavior
The agent should have access to all the tools defined in multiple_tools.py
Actual Behavior
The agent only has access to the last defined @tool in the file - the rest are ignored.
Additional Context
If you create a file called multiple_tools.py with multiple @tool definitions and use load_tools_from_directory=True
agent = Agent(load_tools_from_directory=True)
All tools defined by @tool are loaded into the agent.
If you instead pass the file path only the last tool is loaded.
Possible Solution
N/A
Related Issues
#508
Checks
Strands Version
1.3.0
Python Version
3.11.13
Operating System
Linux
Installation Method
pip
Steps to Reproduce
Create a file called multiple_tools.py with multiple unique @tool definitions
Pass tool as file path to Agent:
Expected Behavior
The agent should have access to all the tools defined in multiple_tools.py
Actual Behavior
The agent only has access to the last defined @tool in the file - the rest are ignored.
Additional Context
If you create a file called multiple_tools.py with multiple @tool definitions and use load_tools_from_directory=True
agent = Agent(load_tools_from_directory=True)All tools defined by @tool are loaded into the agent.
If you instead pass the file path only the last tool is loaded.
Possible Solution
N/A
Related Issues
#508