Example Built-in Tools¶
Strands offers an optional example tools package strands-agents-tools
which includes pre-built tools to get started quickly experimenting with agents and tools during development. The package is also open source and available on GitHub.
Install the strands-agents-tools
package by running:
If using mem0_memory
, install the the additional required dependencies by running:
Available Tools¶
RAG & Memory¶
retrieve
: Semantically retrieve data from Amazon Bedrock Knowledge Bases for RAG, memory, and other purposesmemory
: Agent memory persistence in Amazon Bedrock Knowledge Basesmem0_memory
: Agent memory and personalization built on top of Mem0
File Operations¶
editor
: File editing operations like line edits, search, and undofile_read
: Read and parse filesfile_write
: Create and modify files
Shell & System¶
environment
: Manage environment variablesshell
: Execute shell commandscron
: Task scheduling with cron jobs
Code Interpretation¶
python_repl
: Run Python code
Web & Network¶
http_request
: Make API calls, fetch web data, and call local HTTP serversslack
: Slack integration with real-time events, API access, and message sending
Multi-modal¶
generate_image_stability
: Create images with Stability AIimage_reader
: Process and analyze imagesgenerate_image
: Create AI generated images with Amazon Bedrocknova_reels
: Create AI generated videos with Nova Reels on Amazon Bedrockspeak
: Generate speech from text using macOS say command or Amazon Polly
AWS Services¶
use_aws
: Interact with AWS services
Utilities¶
calculator
: Perform mathematical operationscurrent_time
: Get the current date and timeload_tool
: Dynamically load more tools at runtime
Agents & Workflows¶
agent_graph
: Create and manage graphs of agentsjournal
: Create structured tasks and logs for agents to manage and work fromswarm
: Coordinate multiple AI agents in a swarm / network of agentsstop
: Force stop the agent event loophandoff_to_user
: Enable human-in-the-loop workflows by pausing agent execution for user input or transferring control entirely to the userthink
: Perform deep thinking by creating parallel branches of agentic reasoninguse_llm
: Run a new AI event loop with custom promptsworkflow
: Orchestrate sequenced workflowsbatch
: Call multiple tools from a single model request
Tool Consent and Bypassing¶
By default, certain tools that perform potentially sensitive operations (like file modifications, shell commands, or code execution) will prompt for user confirmation before executing. This safety feature ensures users maintain control over actions that could modify their system.
To bypass these confirmation prompts, you can set the BYPASS_TOOL_CONSENT
environment variable:
Setting the environment variable within Python:
When this variable is set to true
, tools will execute without asking for confirmation. This is particularly useful for:
- Automated workflows where user interaction isn't possible
- Development and testing environments
- CI/CD pipelines
- Situations where you've already validated the safety of operations
Note: Use this feature with caution in production environments, as it removes an important safety check.
Human-in-the-Loop with handoff_to_user¶
The handoff_to_user
tool enables human-in-the-loop workflows by allowing agents to pause execution for user input or transfer control entirely to a human operator. It offers two modes: Interactive Mode (breakout_of_loop=False
) which collects input and continues, and Complete Handoff Mode (breakout_of_loop=True
) which stops the event loop and transfers control to the user.
from strands import Agent
from strands_tools import handoff_to_user
agent = Agent(tools=[handoff_to_user])
# Request user input and continue
response = agent.tool.handoff_to_user(
message="I need your approval to proceed. Type 'yes' to confirm.",
breakout_of_loop=False
)
# Complete handoff to user (stops agent execution)
agent.tool.handoff_to_user(
message="Task completed. Please review the results.",
breakout_of_loop=True
)
This tool is designed for terminal environments as an example implementation. For production applications, you may want to implement custom handoff mechanisms tailored to your specific UI/UX requirements, such as web interfaces or messaging platforms.