Repository files navigation

Strands Agents

Strands Agents Tools

A model-driven approach to building AI agents in just a few lines of code.

GitHub commit activityGitHub open issuesGitHub open pull requestsLicensePyPI versionPython versions

DocumentationSamplesPython SDKToolsAgent BuilderMCP Server

Strands Agents Tools provides a powerful set of tools for your agents to use. It bridges the gap between large language models and practical applications by offering ready-to-use tools for file operations, system execution, API interactions, mathematical operations, and more.

✨ Features

  • 📁 File Operations - Read, write, and edit files with syntax highlighting and intelligent modifications
  • 🖥️ Shell Integration - Execute and interact with shell commands securely
  • 🧠 Memory - Store user and agent memories across agent runs to provide personalized experiences with both Mem0 and Amazon Bedrock Knowledge Bases
  • 🌐 HTTP Client - Make API requests with comprehensive authentication support
  • 💬 Slack Client - Real-time Slack events, message processing, and Slack API access
  • 🐍 Python Execution - Run Python code snippets with state persistence, user confirmation for code execution, and safety features
  • 🧮 Mathematical Tools - Perform advanced calculations with symbolic math capabilities
  • ☁️ AWS Integration - Seamless access to AWS services
  • 🖼️ Image Processing - Generate and process images for AI applications
  • 🎥 Video Processing - Use models and agents to generate dynamic videos
  • 🎙️ Audio Output - Enable models to generate audio and speak
  • 🔄 Environment Management - Handle environment variables safely
  • 📝 Journaling - Create and manage structured logs and journals
  • ⏱️ Task Scheduling - Schedule and manage cron jobs
  • 🧠 Advanced Reasoning - Tools for complex thinking and reasoning capabilities
  • 🐝 Swarm Intelligence - Coordinate multiple AI agents for parallel problem solving with shared memory
  • 🔄 Multiple tools in Parallel - Call multiple other tools at the same time in parallel with Batch Tool
  • 🔍 Browser Tool - Tool giving an agent access to perform automated actions on a browser (chromium)

📦 Installation

Quick Install

pip install strands-agents-tools

To install the dependencies for optional tools:

pip install strands-agents-tools[mem0_memory, use_browser]

Development Install

# Clone the repository
git clone https://github.com/strands-agents/tools.git
cd tools
# Create and activate virtual environment
python3 -m venv .venv
source .venv/bin/activate # On Windows: venv\Scripts\activate# Install in development mode
pip install -e ".[dev]"# Install pre-commit hooks
pre-commit install

Tools Overview

Below is a comprehensive table of all available tools, how to use them with an agent, and typical use cases:

ToolAgent UsageUse Case
a2a_clientprovider = A2AClientToolProvider(known_agent_urls=["http://localhost:9000"]); agent = Agent(tools=provider.tools)Discover and communicate with A2A-compliant agents, send messages between agents
file_readagent.tool.file_read(path="path/to/file.txt")Reading configuration files, parsing code files, loading datasets
file_writeagent.tool.file_write(path="path/to/file.txt", content="file content")Writing results to files, creating new files, saving output data
editoragent.tool.editor(command="view", path="path/to/file.py")Advanced file operations like syntax highlighting, pattern replacement, and multi-file edits
shell*agent.tool.shell(command="ls -la")Executing shell commands, interacting with the operating system, running scripts
http_requestagent.tool.http_request(method="GET", url="https://api.example.com/data")Making API calls, fetching web data, sending data to external services
python_repl*agent.tool.python_repl(code="import pandas as pd\ndf = pd.read_csv('data.csv')\nprint(df.head())")Running Python code snippets, data analysis, executing complex logic with user confirmation for security
calculatoragent.tool.calculator(expression="2 * sin(pi/4) + log(e**2)")Performing mathematical operations, symbolic math, equation solving
use_awsagent.tool.use_aws(service_name="s3", operation_name="list_buckets", parameters={}, region="us-west-2")Interacting with AWS services, cloud resource management
retrieveagent.tool.retrieve(text="What is STRANDS?")Retrieving information from Amazon Bedrock Knowledge Bases
nova_reelsagent.tool.nova_reels(action="create", text="A cinematic shot of mountains", s3_bucket="my-bucket")Create high-quality videos using Amazon Bedrock Nova Reel with configurable parameters via environment variables
mem0_memoryagent.tool.mem0_memory(action="store", content="Remember I like to play tennis", user_id="alex")Store user and agent memories across agent runs to provide personalized experience
memoryagent.tool.memory(action="retrieve", query="product features")Store, retrieve, list, and manage documents in Amazon Bedrock Knowledge Bases with configurable parameters via environment variables
environmentagent.tool.environment(action="list", prefix="AWS_")Managing environment variables, configuration management
generate_image_stabilityagent.tool.generate_image_stability(prompt="A tranquil pool")Creating images using Stability AI models
generate_imageagent.tool.generate_image(prompt="A sunset over mountains")Creating AI-generated images for various applications
image_readeragent.tool.image_reader(image_path="path/to/image.jpg")Processing and reading image files for AI analysis
journalagent.tool.journal(action="write", content="Today's progress notes")Creating structured logs, maintaining documentation
thinkagent.tool.think(thought="Complex problem to analyze", cycle_count=3)Advanced reasoning, multi-step thinking processes
load_toolagent.tool.load_tool(path="path/to/custom_tool.py", name="custom_tool")Dynamically loading custom tools and extensions
swarmagent.tool.swarm(task="Analyze this problem", swarm_size=3, coordination_pattern="collaborative")Coordinating multiple AI agents to solve complex problems through collective intelligence
current_timeagent.tool.current_time(timezone="US/Pacific")Get the current time in ISO 8601 format for a specified timezone
sleepagent.tool.sleep(seconds=5)Pause execution for the specified number of seconds, interruptible with SIGINT (Ctrl+C)
agent_graphagent.tool.agent_graph(agents=["agent1", "agent2"], connections=[{"from": "agent1", "to": "agent2"}])Create and visualize agent relationship graphs for complex multi-agent systems
cron*agent.tool.cron(action="schedule", name="task", schedule="0 * * * *", command="backup.sh")Schedule and manage recurring tasks with cron job syntax
**Does not work on Windows
slackagent.tool.slack(action="post_message", channel="general", text="Hello team!")Interact with Slack workspace for messaging and monitoring
speakagent.tool.speak(text="Operation completed successfully", style="green", mode="polly")Output status messages with rich formatting and optional text-to-speech
stopagent.tool.stop(message="Process terminated by user request")Gracefully terminate agent execution with custom message
handoff_to_useragent.tool.handoff_to_user(message="Please confirm action", breakout_of_loop=False)Hand off control to user for confirmation, input, or complete task handoff
use_llmagent.tool.use_llm(prompt="Analyze this data", system_prompt="You are a data analyst")Create nested AI loops with customized system prompts for specialized tasks
workflowagent.tool.workflow(action="create", name="data_pipeline", steps=[{"tool": "file_read"}, {"tool": "python_repl"}])Define, execute, and manage multi-step automated workflows
batchagent.tool.batch(invocations=[{"name": "current_time", "arguments": {"timezone": "Europe/London"}}, {"name": "stop", "arguments": {}}])Call multiple other tools in parallel.
use_browseragent.tool.use_browser(action="navigate", url="https://www.example.com") Web scraping, automated testing, form filling, web automation tasks

* These tools do not work on windows

💻 Usage Examples

File Operations

fromstrandsimportAgentfromstrands_toolsimportfile_read, file_write, editoragent=Agent(tools=[file_read, file_write, editor])
agent.tool.file_read(path="config.json")
agent.tool.file_write(path="output.txt", content="Hello, world!")
agent.tool.editor(command="view", path="script.py")

Shell Commands

Note: shell does not work on Windows.

fromstrandsimportAgentfromstrands_toolsimportshellagent=Agent(tools=[shell])
# Execute a single commandresult=agent.tool.shell(command="ls -la")
# Execute a sequence of commandsresults=agent.tool.shell(command=["mkdir -p test_dir", "cd test_dir", "touch test.txt"])
# Execute commands with error handlingagent.tool.shell(command="risky-command", ignore_errors=True)

HTTP Requests

fromstrandsimportAgentfromstrands_toolsimporthttp_requestagent=Agent(tools=[http_request])
# Make a simple GET requestresponse=agent.tool.http_request(
method="GET",
url="https://api.example.com/data"
)
# POST request with authenticationresponse=agent.tool.http_request(
method="POST",
url="https://api.example.com/resource",
headers={"Content-Type": "application/json"},
body=json.dumps({"key": "value"}),
auth_type="Bearer",
auth_token="your_token_here"
)
# Convert HTML webpages to markdown for better readabilityresponse=agent.tool.http_request(
method="GET",
url="https://example.com/article",
convert_to_markdown=True
)

Python Code Execution

Note: python_repl does not work on Windows.

fromstrandsimportAgentfromstrands_toolsimportpython_replagent=Agent(tools=[python_repl])
# Execute Python code with state persistenceresult=agent.tool.python_repl(code="""import pandas as pd# Load and process datadata = pd.read_csv('data.csv')processed = data.groupby('category').mean()processed.head()""")

Swarm Intelligence

fromstrandsimportAgentfromstrands_toolsimportswarmagent=Agent(tools=[swarm])
# Create a collaborative swarm of agents to tackle a complex problemresult=agent.tool.swarm(
task="Generate creative solutions for reducing plastic waste in urban areas",
swarm_size=5,
coordination_pattern="collaborative"
)
# Create a competitive swarm for diverse solution generationresult=agent.tool.swarm(
task="Design an innovative product for smart home automation",
swarm_size=3,
coordination_pattern="competitive"
)
# Hybrid approach combining collaboration and competitionresult=agent.tool.swarm(
task="Develop marketing strategies for a new sustainable fashion brand",
swarm_size=4,
coordination_pattern="hybrid"
)

Use AWS

fromstrandsimportAgentfromstrands_toolsimportuse_awsagent=Agent(tools=[use_aws])
# List S3 bucketsresult=agent.tool.use_aws(
service_name="s3",
operation_name="list_buckets",
parameters={},
region="us-east-1",
label="List all S3 buckets"
)
# Get the contents of a specific S3 bucketresult=agent.tool.use_aws(
service_name="s3",
operation_name="list_objects_v2",
parameters={"Bucket": "example-bucket"}, # Replace with your actual bucket nameregion="us-east-1",
label="List objects in a specific S3 bucket"
)
# Get the list of EC2 subnetsresult=agent.tool.use_aws(
service_name="ec2",
operation_name="describe_subnets",
parameters={},
region="us-east-1",
label="List all subnets"
)

Batch Tool

importosimportsysfromstrandsimportAgentfromstrands_toolsimportbatch, http_request, use_aws# Example usage of the batch with http_request and use_aws toolsagent=Agent(tools=[batch, http_request, use_aws])
result=agent.tool.batch(
invocations=[
{"name": "http_request", "arguments": {"method": "GET", "url": "https://api.ipify.org?format=json"}},
{
"name": "use_aws",
"arguments": {
"service_name": "s3",
"operation_name": "list_buckets",
"parameters": {},
"region": "us-east-1",
"label": "List S3 Buckets"
}
},
]
)

Use Browser

fromstrandsimportAgentfromstrands_toolsimportuse_browseragent=Agent(tools=[use_browser])
# Simple navigationresult=agent.tool.use_browser(action="navigate", url="https://example.com")
# Sequential actions for form fillingresult=agent.tool.use_browser(actions=[
{"action": "navigate", "args": {"url": "https://example.com/login"}},
{"action": "type", "args": {"selector": "#username", "text": "user@example.com"}},
{"action": "click", "args": {"selector": "#submit"}}
])
# Web scraping with content extractionresult=agent.tool.use_browser(actions=[
{"action": "navigate", "args": {"url": "https://example.com/data"}},
{"action": "get_text", "args": {"selector": ".content"}},
{"action": "click", "args": {"selector": ".next-page"}},
{"action": "get_html", "args": {"selector": "main"}}
])

Handoff to User

fromstrandsimportAgentfromstrands_toolsimporthandoff_to_useragent=Agent(tools=[handoff_to_user])
# Request user confirmation and continueresponse=agent.tool.handoff_to_user(
message="I need your approval to proceed with deleting these files. 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 and take any necessary follow-up actions.",
breakout_of_loop=True
)

A2A Client

fromstrandsimportAgentfromstrands_tools.a2a_clientimportA2AClientToolProvider# Initialize the A2A client provider with known agent URLsprovider=A2AClientToolProvider(known_agent_urls=["http://localhost:9000"])
agent=Agent(tools=provider.tools)
# Use natural language to interact with A2A agentsresponse=agent("discover available agents and send a greeting message")
# The agent will automatically use the available tools:# - discover_agent(url) to find agents# - list_discovered_agents() to see all discovered agents# - send_message(message_text, target_agent_url) to communicate

🌍 Environment Variables Configuration

Agents Tools provides extensive customization through environment variables. This allows you to configure tool behavior without modifying code, making it ideal for different environments (development, testing, production).

Global Environment Variables

These variables affect multiple tools:

Environment VariableDescriptionDefaultAffected Tools
BYPASS_TOOL_CONSENTBypass consent for tool invocation, set to "true" to enablefalseAll tools that require consent (e.g. shell, file_write, python_repl)
STRANDS_TOOL_CONSOLE_MODEEnable rich UI for tools, set to "enabled" to enabledisabledAll tools that have optional rich UI
AWS_REGIONDefault AWS region for AWS operationsus-west-2use_aws, retrieve, generate_image, memory, nova_reels
AWS_PROFILEAWS profile name to use from ~/.aws/credentialsdefaultuse_aws, retrieve
LOG_LEVELLogging level (DEBUG, INFO, WARNING, ERROR)INFOAll tools

Tool-Specific Environment Variables

Calculator Tool

Environment VariableDescriptionDefault
CALCULATOR_MODEDefault calculation modeevaluate
CALCULATOR_PRECISIONNumber of decimal places for results10
CALCULATOR_SCIENTIFICWhether to use scientific notation for numbersFalse
CALCULATOR_FORCE_NUMERICForce numeric evaluation of symbolic expressionsFalse
CALCULATOR_FORCE_SCIENTIFIC_THRESHOLDThreshold for automatic scientific notation1e21
CALCULATOR_DERIVE_ORDERDefault order for derivatives1
CALCULATOR_SERIES_POINTDefault point for series expansion0
CALCULATOR_SERIES_ORDERDefault order for series expansion5

Current Time Tool

Environment VariableDescriptionDefault
DEFAULT_TIMEZONEDefault timezone for current_time toolUTC

Sleep Tool

Environment VariableDescriptionDefault
MAX_SLEEP_SECONDSMaximum allowed sleep duration in seconds300

Mem0 Memory Tool

The Mem0 Memory Tool supports three different backend configurations:

  1. Mem0 Platform:

    • Uses the Mem0 Platform API for memory management
    • Requires a Mem0 API key
  2. OpenSearch (Recommended for AWS environments):

    • Uses OpenSearch as the vector store backend
    • Requires AWS credentials and OpenSearch configuration
  3. FAISS (Default for local development):

    • Uses FAISS as the local vector store backend
    • Requires faiss-cpu package for local vector storage
Environment VariableDescriptionDefaultRequired For
MEM0_API_KEYMem0 Platform API keyNoneMem0 Platform
OPENSEARCH_HOSTOpenSearch Host URLNoneOpenSearch
AWS_REGIONAWS Region for OpenSearchus-west-2OpenSearch
DEVEnable development mode (bypasses confirmations)falseAll modes

Note:

  • If MEM0_API_KEY is set, the tool will use the Mem0 Platform
  • If OPENSEARCH_HOST is set, the tool will use OpenSearch
  • If neither is set, the tool will default to FAISS (requires faiss-cpu package)

Memory Tool

Environment VariableDescriptionDefault
MEMORY_DEFAULT_MAX_RESULTSDefault maximum results for list operations50
MEMORY_DEFAULT_MIN_SCOREDefault minimum relevance score for filtering results0.4

Nova Reels Tool

Environment VariableDescriptionDefault
NOVA_REEL_DEFAULT_SEEDDefault seed for video generation0
NOVA_REEL_DEFAULT_FPSDefault frames per second for generated videos24
NOVA_REEL_DEFAULT_DIMENSIONDefault video resolution in WIDTHxHEIGHT format1280x720
NOVA_REEL_DEFAULT_MAX_RESULTSDefault maximum number of jobs to return for list action10

Python REPL Tool

Environment VariableDescriptionDefault
PYTHON_REPL_BINARY_MAX_LENMaximum length for binary content before truncation100

Shell Tool

Environment VariableDescriptionDefault
SHELL_DEFAULT_TIMEOUTDefault timeout in seconds for shell commands900

Slack Tool

Environment VariableDescriptionDefault
SLACK_DEFAULT_EVENT_COUNTDefault number of events to retrieve42
STRANDS_SLACK_AUTO_REPLYEnable automatic replies to messagesfalse
STRANDS_SLACK_LISTEN_ONLY_TAGOnly process messages containing this tagNone

Speak Tool

Environment VariableDescriptionDefault
SPEAK_DEFAULT_STYLEDefault style for status messagesgreen
SPEAK_DEFAULT_MODEDefault speech mode (fast/polly)fast
SPEAK_DEFAULT_VOICE_IDDefault Polly voice IDJoanna
SPEAK_DEFAULT_OUTPUT_PATHDefault audio output pathspeech_output.mp3
SPEAK_DEFAULT_PLAY_AUDIOWhether to play audio by defaultTrue

Editor Tool

Environment VariableDescriptionDefault
EDITOR_DIR_TREE_MAX_DEPTHMaximum depth for directory tree visualization2
EDITOR_DEFAULT_STYLEDefault style for output panelsdefault
EDITOR_DEFAULT_LANGUAGEDefault language for syntax highlightingpython

Environment Tool

Environment VariableDescriptionDefault
ENV_VARS_MASKED_DEFAULTDefault setting for masking sensitive valuestrue

File Read Tool

Environment VariableDescriptionDefault
FILE_READ_RECURSIVE_DEFAULTDefault setting for recursive file searchingtrue
FILE_READ_CONTEXT_LINES_DEFAULTDefault number of context lines around search matches2
FILE_READ_START_LINE_DEFAULTDefault starting line number for lines mode0
FILE_READ_CHUNK_OFFSET_DEFAULTDefault byte offset for chunk mode0
FILE_READ_DIFF_TYPE_DEFAULTDefault diff type for file comparisonsunified
FILE_READ_USE_GIT_DEFAULTDefault setting for using git in time machine modetrue
FILE_READ_NUM_REVISIONS_DEFAULTDefault number of revisions to show in time machine mode5

Use Browser Tool

Environment VariableDescriptionDefault
STRANDS_DEFAULT_WAIT_TIMEDefault setting for wait time with actions1
STRANDS_BROWSER_MAX_RETRIESDefault number of retries to perform when an action fails3
STRANDS_BROWSER_RETRY_DELAYDefault retry delay time for retry mechanisms1
STRANDS_BROWSER_SCREENSHOTS_DIRDefault directory where screenshots will be savedscreenshots
STRANDS_BROWSER_USER_DATA_DIRDefault directory where data for reloading a browser instance is stored~/.browser_automation
STRANDS_BROWSER_HEADLESSDefault headless setting for launching browsersfalse
STRANDS_BROWSER_WIDTHDefault width of the browser1280
STRANDS_BROWSER_HEIGHTDefault height of the browser800

Contributing ❤️

This is a community-driven project, powered by passionate developers like you. We enthusiastically welcome contributions from everyone, regardless of experience level—your unique perspective is valuable to us!

How to Get Started?

  1. Find your first opportunity: If you're new to the project, explore our labeled "good first issues" for beginner-friendly tasks.
  2. Understand our workflow: Review our Contributing Guide to learn about our development setup, coding standards, and pull request process.
  3. Make your impact: Contributions come in many forms—fixing bugs, enhancing documentation, improving performance, adding features, writing tests, or refining the user experience.
  4. Submit your work: When you're ready, submit a well-documented pull request, and our maintainers will provide feedback to help get your changes merged.

Your questions, insights, and ideas are always welcome!

Together, we're building something meaningful that impacts real users. We look forward to collaborating with you!

License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

Security

See CONTRIBUTING for more information.

About

A set of tools that gives agents powerful capabilities.

Resources

Code of conduct

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content

Repository files navigation

Strands Agents

Strands Agents Tools

A model-driven approach to building AI agents in just a few lines of code.

GitHub commit activityGitHub open issuesGitHub open pull requestsLicensePyPI versionPython versions

DocumentationSamplesPython SDKToolsAgent BuilderMCP Server

Strands Agents Tools provides a powerful set of tools for your agents to use. It bridges the gap between large language models and practical applications by offering ready-to-use tools for file operations, system execution, API interactions, mathematical operations, and more.

✨ Features

  • 📁 File Operations - Read, write, and edit files with syntax highlighting and intelligent modifications
  • 🖥️ Shell Integration - Execute and interact with shell commands securely
  • 🧠 Memory - Store user and agent memories across agent runs to provide personalized experiences with both Mem0 and Amazon Bedrock Knowledge Bases
  • 🌐 HTTP Client - Make API requests with comprehensive authentication support
  • 💬 Slack Client - Real-time Slack events, message processing, and Slack API access
  • 🐍 Python Execution - Run Python code snippets with state persistence, user confirmation for code execution, and safety features
  • 🧮 Mathematical Tools - Perform advanced calculations with symbolic math capabilities
  • ☁️ AWS Integration - Seamless access to AWS services
  • 🖼️ Image Processing - Generate and process images for AI applications
  • 🎥 Video Processing - Use models and agents to generate dynamic videos
  • 🎙️ Audio Output - Enable models to generate audio and speak
  • 🔄 Environment Management - Handle environment variables safely
  • 📝 Journaling - Create and manage structured logs and journals
  • ⏱️ Task Scheduling - Schedule and manage cron jobs
  • 🧠 Advanced Reasoning - Tools for complex thinking and reasoning capabilities
  • 🐝 Swarm Intelligence - Coordinate multiple AI agents for parallel problem solving with shared memory
  • 🔄 Multiple tools in Parallel - Call multiple other tools at the same time in parallel with Batch Tool
  • 🔍 Browser Tool - Tool giving an agent access to perform automated actions on a browser (chromium)

📦 Installation

Quick Install

pip install strands-agents-tools

To install the dependencies for optional tools:

pip install strands-agents-tools[mem0_memory, use_browser]

Development Install

# Clone the repository
git clone https://github.com/strands-agents/tools.git
cd tools
# Create and activate virtual environment
python3 -m venv .venv
source .venv/bin/activate # On Windows: venv\Scripts\activate# Install in development mode
pip install -e ".[dev]"# Install pre-commit hooks
pre-commit install

Tools Overview

Below is a comprehensive table of all available tools, how to use them with an agent, and typical use cases:

ToolAgent UsageUse Case
a2a_clientprovider = A2AClientToolProvider(known_agent_urls=["http://localhost:9000"]); agent = Agent(tools=provider.tools)Discover and communicate with A2A-compliant agents, send messages between agents
file_readagent.tool.file_read(path="path/to/file.txt")Reading configuration files, parsing code files, loading datasets
file_writeagent.tool.file_write(path="path/to/file.txt", content="file content")Writing results to files, creating new files, saving output data
editoragent.tool.editor(command="view", path="path/to/file.py")Advanced file operations like syntax highlighting, pattern replacement, and multi-file edits
shell*agent.tool.shell(command="ls -la")Executing shell commands, interacting with the operating system, running scripts
http_requestagent.tool.http_request(method="GET", url="https://api.example.com/data")Making API calls, fetching web data, sending data to external services
python_repl*agent.tool.python_repl(code="import pandas as pd\ndf = pd.read_csv('data.csv')\nprint(df.head())")Running Python code snippets, data analysis, executing complex logic with user confirmation for security
calculatoragent.tool.calculator(expression="2 * sin(pi/4) + log(e**2)")Performing mathematical operations, symbolic math, equation solving
use_awsagent.tool.use_aws(service_name="s3", operation_name="list_buckets", parameters={}, region="us-west-2")Interacting with AWS services, cloud resource management
retrieveagent.tool.retrieve(text="What is STRANDS?")Retrieving information from Amazon Bedrock Knowledge Bases
nova_reelsagent.tool.nova_reels(action="create", text="A cinematic shot of mountains", s3_bucket="my-bucket")Create high-quality videos using Amazon Bedrock Nova Reel with configurable parameters via environment variables
mem0_memoryagent.tool.mem0_memory(action="store", content="Remember I like to play tennis", user_id="alex")Store user and agent memories across agent runs to provide personalized experience
memoryagent.tool.memory(action="retrieve", query="product features")Store, retrieve, list, and manage documents in Amazon Bedrock Knowledge Bases with configurable parameters via environment variables
environmentagent.tool.environment(action="list", prefix="AWS_")Managing environment variables, configuration management
generate_image_stabilityagent.tool.generate_image_stability(prompt="A tranquil pool")Creating images using Stability AI models
generate_imageagent.tool.generate_image(prompt="A sunset over mountains")Creating AI-generated images for various applications
image_readeragent.tool.image_reader(image_path="path/to/image.jpg")Processing and reading image files for AI analysis
journalagent.tool.journal(action="write", content="Today's progress notes")Creating structured logs, maintaining documentation
thinkagent.tool.think(thought="Complex problem to analyze", cycle_count=3)Advanced reasoning, multi-step thinking processes
load_toolagent.tool.load_tool(path="path/to/custom_tool.py", name="custom_tool")Dynamically loading custom tools and extensions
swarmagent.tool.swarm(task="Analyze this problem", swarm_size=3, coordination_pattern="collaborative")Coordinating multiple AI agents to solve complex problems through collective intelligence
current_timeagent.tool.current_time(timezone="US/Pacific")Get the current time in ISO 8601 format for a specified timezone
sleepagent.tool.sleep(seconds=5)Pause execution for the specified number of seconds, interruptible with SIGINT (Ctrl+C)
agent_graphagent.tool.agent_graph(agents=["agent1", "agent2"], connections=[{"from": "agent1", "to": "agent2"}])Create and visualize agent relationship graphs for complex multi-agent systems
cron*agent.tool.cron(action="schedule", name="task", schedule="0 * * * *", command="backup.sh")Schedule and manage recurring tasks with cron job syntax
**Does not work on Windows
slackagent.tool.slack(action="post_message", channel="general", text="Hello team!")Interact with Slack workspace for messaging and monitoring
speakagent.tool.speak(text="Operation completed successfully", style="green", mode="polly")Output status messages with rich formatting and optional text-to-speech
stopagent.tool.stop(message="Process terminated by user request")Gracefully terminate agent execution with custom message
handoff_to_useragent.tool.handoff_to_user(message="Please confirm action", breakout_of_loop=False)Hand off control to user for confirmation, input, or complete task handoff
use_llmagent.tool.use_llm(prompt="Analyze this data", system_prompt="You are a data analyst")Create nested AI loops with customized system prompts for specialized tasks
workflowagent.tool.workflow(action="create", name="data_pipeline", steps=[{"tool": "file_read"}, {"tool": "python_repl"}])Define, execute, and manage multi-step automated workflows
batchagent.tool.batch(invocations=[{"name": "current_time", "arguments": {"timezone": "Europe/London"}}, {"name": "stop", "arguments": {}}])Call multiple other tools in parallel.
use_browseragent.tool.use_browser(action="navigate", url="https://www.example.com") Web scraping, automated testing, form filling, web automation tasks

* These tools do not work on windows

💻 Usage Examples

File Operations

fromstrandsimportAgentfromstrands_toolsimportfile_read, file_write, editoragent=Agent(tools=[file_read, file_write, editor])
agent.tool.file_read(path="config.json")
agent.tool.file_write(path="output.txt", content="Hello, world!")
agent.tool.editor(command="view", path="script.py")

Shell Commands

Note: shell does not work on Windows.

fromstrandsimportAgentfromstrands_toolsimportshellagent=Agent(tools=[shell])
# Execute a single commandresult=agent.tool.shell(command="ls -la")
# Execute a sequence of commandsresults=agent.tool.shell(command=["mkdir -p test_dir", "cd test_dir", "touch test.txt"])
# Execute commands with error handlingagent.tool.shell(command="risky-command", ignore_errors=True)

HTTP Requests

fromstrandsimportAgentfromstrands_toolsimporthttp_requestagent=Agent(tools=[http_request])
# Make a simple GET requestresponse=agent.tool.http_request(
method="GET",
url="https://api.example.com/data"
)
# POST request with authenticationresponse=agent.tool.http_request(
method="POST",
url="https://api.example.com/resource",
headers={"Content-Type": "application/json"},
body=json.dumps({"key": "value"}),
auth_type="Bearer",
auth_token="your_token_here"
)
# Convert HTML webpages to markdown for better readabilityresponse=agent.tool.http_request(
method="GET",
url="https://example.com/article",
convert_to_markdown=True
)

Python Code Execution

Note: python_repl does not work on Windows.

fromstrandsimportAgentfromstrands_toolsimportpython_replagent=Agent(tools=[python_repl])
# Execute Python code with state persistenceresult=agent.tool.python_repl(code="""import pandas as pd# Load and process datadata = pd.read_csv('data.csv')processed = data.groupby('category').mean()processed.head()""")

Swarm Intelligence

fromstrandsimportAgentfromstrands_toolsimportswarmagent=Agent(tools=[swarm])
# Create a collaborative swarm of agents to tackle a complex problemresult=agent.tool.swarm(
task="Generate creative solutions for reducing plastic waste in urban areas",
swarm_size=5,
coordination_pattern="collaborative"
)
# Create a competitive swarm for diverse solution generationresult=agent.tool.swarm(
task="Design an innovative product for smart home automation",
swarm_size=3,
coordination_pattern="competitive"
)
# Hybrid approach combining collaboration and competitionresult=agent.tool.swarm(
task="Develop marketing strategies for a new sustainable fashion brand",
swarm_size=4,
coordination_pattern="hybrid"
)

Use AWS

fromstrandsimportAgentfromstrands_toolsimportuse_awsagent=Agent(tools=[use_aws])
# List S3 bucketsresult=agent.tool.use_aws(
service_name="s3",
operation_name="list_buckets",
parameters={},
region="us-east-1",
label="List all S3 buckets"
)
# Get the contents of a specific S3 bucketresult=agent.tool.use_aws(
service_name="s3",
operation_name="list_objects_v2",
parameters={"Bucket": "example-bucket"}, # Replace with your actual bucket nameregion="us-east-1",
label="List objects in a specific S3 bucket"
)
# Get the list of EC2 subnetsresult=agent.tool.use_aws(
service_name="ec2",
operation_name="describe_subnets",
parameters={},
region="us-east-1",
label="List all subnets"
)

Batch Tool

importosimportsysfromstrandsimportAgentfromstrands_toolsimportbatch, http_request, use_aws# Example usage of the batch with http_request and use_aws toolsagent=Agent(tools=[batch, http_request, use_aws])
result=agent.tool.batch(
invocations=[
{"name": "http_request", "arguments": {"method": "GET", "url": "https://api.ipify.org?format=json"}},
{
"name": "use_aws",
"arguments": {
"service_name": "s3",
"operation_name": "list_buckets",
"parameters": {},
"region": "us-east-1",
"label": "List S3 Buckets"
}
},
]
)

Use Browser

fromstrandsimportAgentfromstrands_toolsimportuse_browseragent=Agent(tools=[use_browser])
# Simple navigationresult=agent.tool.use_browser(action="navigate", url="https://example.com")
# Sequential actions for form fillingresult=agent.tool.use_browser(actions=[
{"action": "navigate", "args": {"url": "https://example.com/login"}},
{"action": "type", "args": {"selector": "#username", "text": "user@example.com"}},
{"action": "click", "args": {"selector": "#submit"}}
])
# Web scraping with content extractionresult=agent.tool.use_browser(actions=[
{"action": "navigate", "args": {"url": "https://example.com/data"}},
{"action": "get_text", "args": {"selector": ".content"}},
{"action": "click", "args": {"selector": ".next-page"}},
{"action": "get_html", "args": {"selector": "main"}}
])

Handoff to User

fromstrandsimportAgentfromstrands_toolsimporthandoff_to_useragent=Agent(tools=[handoff_to_user])
# Request user confirmation and continueresponse=agent.tool.handoff_to_user(
message="I need your approval to proceed with deleting these files. 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 and take any necessary follow-up actions.",
breakout_of_loop=True
)

A2A Client

fromstrandsimportAgentfromstrands_tools.a2a_clientimportA2AClientToolProvider# Initialize the A2A client provider with known agent URLsprovider=A2AClientToolProvider(known_agent_urls=["http://localhost:9000"])
agent=Agent(tools=provider.tools)
# Use natural language to interact with A2A agentsresponse=agent("discover available agents and send a greeting message")
# The agent will automatically use the available tools:# - discover_agent(url) to find agents# - list_discovered_agents() to see all discovered agents# - send_message(message_text, target_agent_url) to communicate

🌍 Environment Variables Configuration

Agents Tools provides extensive customization through environment variables. This allows you to configure tool behavior without modifying code, making it ideal for different environments (development, testing, production).

Global Environment Variables

These variables affect multiple tools:

Environment VariableDescriptionDefaultAffected Tools
BYPASS_TOOL_CONSENTBypass consent for tool invocation, set to "true" to enablefalseAll tools that require consent (e.g. shell, file_write, python_repl)
STRANDS_TOOL_CONSOLE_MODEEnable rich UI for tools, set to "enabled" to enabledisabledAll tools that have optional rich UI
AWS_REGIONDefault AWS region for AWS operationsus-west-2use_aws, retrieve, generate_image, memory, nova_reels
AWS_PROFILEAWS profile name to use from ~/.aws/credentialsdefaultuse_aws, retrieve
LOG_LEVELLogging level (DEBUG, INFO, WARNING, ERROR)INFOAll tools

Tool-Specific Environment Variables

Calculator Tool

Environment VariableDescriptionDefault
CALCULATOR_MODEDefault calculation modeevaluate
CALCULATOR_PRECISIONNumber of decimal places for results10
CALCULATOR_SCIENTIFICWhether to use scientific notation for numbersFalse
CALCULATOR_FORCE_NUMERICForce numeric evaluation of symbolic expressionsFalse
CALCULATOR_FORCE_SCIENTIFIC_THRESHOLDThreshold for automatic scientific notation1e21
CALCULATOR_DERIVE_ORDERDefault order for derivatives1
CALCULATOR_SERIES_POINTDefault point for series expansion0
CALCULATOR_SERIES_ORDERDefault order for series expansion5

Current Time Tool

Environment VariableDescriptionDefault
DEFAULT_TIMEZONEDefault timezone for current_time toolUTC

Sleep Tool

Environment VariableDescriptionDefault
MAX_SLEEP_SECONDSMaximum allowed sleep duration in seconds300

Mem0 Memory Tool

The Mem0 Memory Tool supports three different backend configurations:

  1. Mem0 Platform:

    • Uses the Mem0 Platform API for memory management
    • Requires a Mem0 API key
  2. OpenSearch (Recommended for AWS environments):

    • Uses OpenSearch as the vector store backend
    • Requires AWS credentials and OpenSearch configuration
  3. FAISS (Default for local development):

    • Uses FAISS as the local vector store backend
    • Requires faiss-cpu package for local vector storage
Environment VariableDescriptionDefaultRequired For
MEM0_API_KEYMem0 Platform API keyNoneMem0 Platform
OPENSEARCH_HOSTOpenSearch Host URLNoneOpenSearch
AWS_REGIONAWS Region for OpenSearchus-west-2OpenSearch
DEVEnable development mode (bypasses confirmations)falseAll modes

Note:

  • If MEM0_API_KEY is set, the tool will use the Mem0 Platform
  • If OPENSEARCH_HOST is set, the tool will use OpenSearch
  • If neither is set, the tool will default to FAISS (requires faiss-cpu package)

Memory Tool

Environment VariableDescriptionDefault
MEMORY_DEFAULT_MAX_RESULTSDefault maximum results for list operations50
MEMORY_DEFAULT_MIN_SCOREDefault minimum relevance score for filtering results0.4

Nova Reels Tool

Environment VariableDescriptionDefault
NOVA_REEL_DEFAULT_SEEDDefault seed for video generation0
NOVA_REEL_DEFAULT_FPSDefault frames per second for generated videos24
NOVA_REEL_DEFAULT_DIMENSIONDefault video resolution in WIDTHxHEIGHT format1280x720
NOVA_REEL_DEFAULT_MAX_RESULTSDefault maximum number of jobs to return for list action10

Python REPL Tool

Environment VariableDescriptionDefault
PYTHON_REPL_BINARY_MAX_LENMaximum length for binary content before truncation100

Shell Tool

Environment VariableDescriptionDefault
SHELL_DEFAULT_TIMEOUTDefault timeout in seconds for shell commands900

Slack Tool

Environment VariableDescriptionDefault
SLACK_DEFAULT_EVENT_COUNTDefault number of events to retrieve42
STRANDS_SLACK_AUTO_REPLYEnable automatic replies to messagesfalse
STRANDS_SLACK_LISTEN_ONLY_TAGOnly process messages containing this tagNone

Speak Tool

Environment VariableDescriptionDefault
SPEAK_DEFAULT_STYLEDefault style for status messagesgreen
SPEAK_DEFAULT_MODEDefault speech mode (fast/polly)fast
SPEAK_DEFAULT_VOICE_IDDefault Polly voice IDJoanna
SPEAK_DEFAULT_OUTPUT_PATHDefault audio output pathspeech_output.mp3
SPEAK_DEFAULT_PLAY_AUDIOWhether to play audio by defaultTrue

Editor Tool

Environment VariableDescriptionDefault
EDITOR_DIR_TREE_MAX_DEPTHMaximum depth for directory tree visualization2
EDITOR_DEFAULT_STYLEDefault style for output panelsdefault
EDITOR_DEFAULT_LANGUAGEDefault language for syntax highlightingpython

Environment Tool

Environment VariableDescriptionDefault
ENV_VARS_MASKED_DEFAULTDefault setting for masking sensitive valuestrue

File Read Tool

Environment VariableDescriptionDefault
FILE_READ_RECURSIVE_DEFAULTDefault setting for recursive file searchingtrue
FILE_READ_CONTEXT_LINES_DEFAULTDefault number of context lines around search matches2
FILE_READ_START_LINE_DEFAULTDefault starting line number for lines mode0
FILE_READ_CHUNK_OFFSET_DEFAULTDefault byte offset for chunk mode0
FILE_READ_DIFF_TYPE_DEFAULTDefault diff type for file comparisonsunified
FILE_READ_USE_GIT_DEFAULTDefault setting for using git in time machine modetrue
FILE_READ_NUM_REVISIONS_DEFAULTDefault number of revisions to show in time machine mode5

Use Browser Tool

Environment VariableDescriptionDefault
STRANDS_DEFAULT_WAIT_TIMEDefault setting for wait time with actions1
STRANDS_BROWSER_MAX_RETRIESDefault number of retries to perform when an action fails3
STRANDS_BROWSER_RETRY_DELAYDefault retry delay time for retry mechanisms1
STRANDS_BROWSER_SCREENSHOTS_DIRDefault directory where screenshots will be savedscreenshots
STRANDS_BROWSER_USER_DATA_DIRDefault directory where data for reloading a browser instance is stored~/.browser_automation
STRANDS_BROWSER_HEADLESSDefault headless setting for launching browsersfalse
STRANDS_BROWSER_WIDTHDefault width of the browser1280
STRANDS_BROWSER_HEIGHTDefault height of the browser800

Contributing ❤️

This is a community-driven project, powered by passionate developers like you. We enthusiastically welcome contributions from everyone, regardless of experience level—your unique perspective is valuable to us!

How to Get Started?

  1. Find your first opportunity: If you're new to the project, explore our labeled "good first issues" for beginner-friendly tasks.
  2. Understand our workflow: Review our Contributing Guide to learn about our development setup, coding standards, and pull request process.
  3. Make your impact: Contributions come in many forms—fixing bugs, enhancing documentation, improving performance, adding features, writing tests, or refining the user experience.
  4. Submit your work: When you're ready, submit a well-documented pull request, and our maintainers will provide feedback to help get your changes merged.

Your questions, insights, and ideas are always welcome!

Together, we're building something meaningful that impacts real users. We look forward to collaborating with you!

License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

Security

See CONTRIBUTING for more information.

About

A set of tools that gives agents powerful capabilities.

Resources

Code of conduct

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Repository files navigation

Strands Agents

Strands Agents Tools

A model-driven approach to building AI agents in just a few lines of code.

GitHub commit activityGitHub open issuesGitHub open pull requestsLicensePyPI versionPython versions

DocumentationSamplesPython SDKToolsAgent BuilderMCP Server

Strands Agents Tools provides a powerful set of tools for your agents to use. It bridges the gap between large language models and practical applications by offering ready-to-use tools for file operations, system execution, API interactions, mathematical operations, and more.

✨ Features

  • 📁 File Operations - Read, write, and edit files with syntax highlighting and intelligent modifications
  • 🖥️ Shell Integration - Execute and interact with shell commands securely
  • 🧠 Memory - Store user and agent memories across agent runs to provide personalized experiences with both Mem0 and Amazon Bedrock Knowledge Bases
  • 🌐 HTTP Client - Make API requests with comprehensive authentication support
  • 💬 Slack Client - Real-time Slack events, message processing, and Slack API access
  • 🐍 Python Execution - Run Python code snippets with state persistence, user confirmation for code execution, and safety features
  • 🧮 Mathematical Tools - Perform advanced calculations with symbolic math capabilities
  • ☁️ AWS Integration - Seamless access to AWS services
  • 🖼️ Image Processing - Generate and process images for AI applications
  • 🎥 Video Processing - Use models and agents to generate dynamic videos
  • 🎙️ Audio Output - Enable models to generate audio and speak
  • 🔄 Environment Management - Handle environment variables safely
  • 📝 Journaling - Create and manage structured logs and journals
  • ⏱️ Task Scheduling - Schedule and manage cron jobs
  • 🧠 Advanced Reasoning - Tools for complex thinking and reasoning capabilities
  • 🐝 Swarm Intelligence - Coordinate multiple AI agents for parallel problem solving with shared memory
  • 🔄 Multiple tools in Parallel - Call multiple other tools at the same time in parallel with Batch Tool
  • 🔍 Browser Tool - Tool giving an agent access to perform automated actions on a browser (chromium)

📦 Installation

Quick Install

pip install strands-agents-tools

To install the dependencies for optional tools:

pip install strands-agents-tools[mem0_memory, use_browser]

Development Install

# Clone the repository
git clone https://github.com/strands-agents/tools.git
cd tools
# Create and activate virtual environment
python3 -m venv .venv
source .venv/bin/activate # On Windows: venv\Scripts\activate# Install in development mode
pip install -e ".[dev]"# Install pre-commit hooks
pre-commit install

Tools Overview

Below is a comprehensive table of all available tools, how to use them with an agent, and typical use cases:

ToolAgent UsageUse Case
a2a_clientprovider = A2AClientToolProvider(known_agent_urls=["http://localhost:9000"]); agent = Agent(tools=provider.tools)Discover and communicate with A2A-compliant agents, send messages between agents
file_readagent.tool.file_read(path="path/to/file.txt")Reading configuration files, parsing code files, loading datasets
file_writeagent.tool.file_write(path="path/to/file.txt", content="file content")Writing results to files, creating new files, saving output data
editoragent.tool.editor(command="view", path="path/to/file.py")Advanced file operations like syntax highlighting, pattern replacement, and multi-file edits
shell*agent.tool.shell(command="ls -la")Executing shell commands, interacting with the operating system, running scripts
http_requestagent.tool.http_request(method="GET", url="https://api.example.com/data")Making API calls, fetching web data, sending data to external services
python_repl*agent.tool.python_repl(code="import pandas as pd\ndf = pd.read_csv('data.csv')\nprint(df.head())")Running Python code snippets, data analysis, executing complex logic with user confirmation for security
calculatoragent.tool.calculator(expression="2 * sin(pi/4) + log(e**2)")Performing mathematical operations, symbolic math, equation solving
use_awsagent.tool.use_aws(service_name="s3", operation_name="list_buckets", parameters={}, region="us-west-2")Interacting with AWS services, cloud resource management
retrieveagent.tool.retrieve(text="What is STRANDS?")Retrieving information from Amazon Bedrock Knowledge Bases
nova_reelsagent.tool.nova_reels(action="create", text="A cinematic shot of mountains", s3_bucket="my-bucket")Create high-quality videos using Amazon Bedrock Nova Reel with configurable parameters via environment variables
mem0_memoryagent.tool.mem0_memory(action="store", content="Remember I like to play tennis", user_id="alex")Store user and agent memories across agent runs to provide personalized experience
memoryagent.tool.memory(action="retrieve", query="product features")Store, retrieve, list, and manage documents in Amazon Bedrock Knowledge Bases with configurable parameters via environment variables
environmentagent.tool.environment(action="list", prefix="AWS_")Managing environment variables, configuration management
generate_image_stabilityagent.tool.generate_image_stability(prompt="A tranquil pool")Creating images using Stability AI models
generate_imageagent.tool.generate_image(prompt="A sunset over mountains")Creating AI-generated images for various applications
image_readeragent.tool.image_reader(image_path="path/to/image.jpg")Processing and reading image files for AI analysis
journalagent.tool.journal(action="write", content="Today's progress notes")Creating structured logs, maintaining documentation
thinkagent.tool.think(thought="Complex problem to analyze", cycle_count=3)Advanced reasoning, multi-step thinking processes
load_toolagent.tool.load_tool(path="path/to/custom_tool.py", name="custom_tool")Dynamically loading custom tools and extensions
swarmagent.tool.swarm(task="Analyze this problem", swarm_size=3, coordination_pattern="collaborative")Coordinating multiple AI agents to solve complex problems through collective intelligence
current_timeagent.tool.current_time(timezone="US/Pacific")Get the current time in ISO 8601 format for a specified timezone
sleepagent.tool.sleep(seconds=5)Pause execution for the specified number of seconds, interruptible with SIGINT (Ctrl+C)
agent_graphagent.tool.agent_graph(agents=["agent1", "agent2"], connections=[{"from": "agent1", "to": "agent2"}])Create and visualize agent relationship graphs for complex multi-agent systems
cron*agent.tool.cron(action="schedule", name="task", schedule="0 * * * *", command="backup.sh")Schedule and manage recurring tasks with cron job syntax
**Does not work on Windows
slackagent.tool.slack(action="post_message", channel="general", text="Hello team!")Interact with Slack workspace for messaging and monitoring
speakagent.tool.speak(text="Operation completed successfully", style="green", mode="polly")Output status messages with rich formatting and optional text-to-speech
stopagent.tool.stop(message="Process terminated by user request")Gracefully terminate agent execution with custom message
handoff_to_useragent.tool.handoff_to_user(message="Please confirm action", breakout_of_loop=False)Hand off control to user for confirmation, input, or complete task handoff
use_llmagent.tool.use_llm(prompt="Analyze this data", system_prompt="You are a data analyst")Create nested AI loops with customized system prompts for specialized tasks
workflowagent.tool.workflow(action="create", name="data_pipeline", steps=[{"tool": "file_read"}, {"tool": "python_repl"}])Define, execute, and manage multi-step automated workflows
batchagent.tool.batch(invocations=[{"name": "current_time", "arguments": {"timezone": "Europe/London"}}, {"name": "stop", "arguments": {}}])Call multiple other tools in parallel.
use_browseragent.tool.use_browser(action="navigate", url="https://www.example.com") Web scraping, automated testing, form filling, web automation tasks

* These tools do not work on windows

💻 Usage Examples

File Operations

fromstrandsimportAgentfromstrands_toolsimportfile_read, file_write, editoragent=Agent(tools=[file_read, file_write, editor])
agent.tool.file_read(path="config.json")
agent.tool.file_write(path="output.txt", content="Hello, world!")
agent.tool.editor(command="view", path="script.py")

Shell Commands

Note: shell does not work on Windows.

fromstrandsimportAgentfromstrands_toolsimportshellagent=Agent(tools=[shell])
# Execute a single commandresult=agent.tool.shell(command="ls -la")
# Execute a sequence of commandsresults=agent.tool.shell(command=["mkdir -p test_dir", "cd test_dir", "touch test.txt"])
# Execute commands with error handlingagent.tool.shell(command="risky-command", ignore_errors=True)

HTTP Requests

fromstrandsimportAgentfromstrands_toolsimporthttp_requestagent=Agent(tools=[http_request])
# Make a simple GET requestresponse=agent.tool.http_request(
method="GET",
url="https://api.example.com/data"
)
# POST request with authenticationresponse=agent.tool.http_request(
method="POST",
url="https://api.example.com/resource",
headers={"Content-Type": "application/json"},
body=json.dumps({"key": "value"}),
auth_type="Bearer",
auth_token="your_token_here"
)
# Convert HTML webpages to markdown for better readabilityresponse=agent.tool.http_request(
method="GET",
url="https://example.com/article",
convert_to_markdown=True
)

Python Code Execution

Note: python_repl does not work on Windows.

fromstrandsimportAgentfromstrands_toolsimportpython_replagent=Agent(tools=[python_repl])
# Execute Python code with state persistenceresult=agent.tool.python_repl(code="""import pandas as pd# Load and process datadata = pd.read_csv('data.csv')processed = data.groupby('category').mean()processed.head()""")

Swarm Intelligence

fromstrandsimportAgentfromstrands_toolsimportswarmagent=Agent(tools=[swarm])
# Create a collaborative swarm of agents to tackle a complex problemresult=agent.tool.swarm(
task="Generate creative solutions for reducing plastic waste in urban areas",
swarm_size=5,
coordination_pattern="collaborative"
)
# Create a competitive swarm for diverse solution generationresult=agent.tool.swarm(
task="Design an innovative product for smart home automation",
swarm_size=3,
coordination_pattern="competitive"
)
# Hybrid approach combining collaboration and competitionresult=agent.tool.swarm(
task="Develop marketing strategies for a new sustainable fashion brand",
swarm_size=4,
coordination_pattern="hybrid"
)

Use AWS

fromstrandsimportAgentfromstrands_toolsimportuse_awsagent=Agent(tools=[use_aws])
# List S3 bucketsresult=agent.tool.use_aws(
service_name="s3",
operation_name="list_buckets",
parameters={},
region="us-east-1",
label="List all S3 buckets"
)
# Get the contents of a specific S3 bucketresult=agent.tool.use_aws(
service_name="s3",
operation_name="list_objects_v2",
parameters={"Bucket": "example-bucket"}, # Replace with your actual bucket nameregion="us-east-1",
label="List objects in a specific S3 bucket"
)
# Get the list of EC2 subnetsresult=agent.tool.use_aws(
service_name="ec2",
operation_name="describe_subnets",
parameters={},
region="us-east-1",
label="List all subnets"
)

Batch Tool

importosimportsysfromstrandsimportAgentfromstrands_toolsimportbatch, http_request, use_aws# Example usage of the batch with http_request and use_aws toolsagent=Agent(tools=[batch, http_request, use_aws])
result=agent.tool.batch(
invocations=[
{"name": "http_request", "arguments": {"method": "GET", "url": "https://api.ipify.org?format=json"}},
{
"name": "use_aws",
"arguments": {
"service_name": "s3",
"operation_name": "list_buckets",
"parameters": {},
"region": "us-east-1",
"label": "List S3 Buckets"
}
},
]
)

Use Browser

fromstrandsimportAgentfromstrands_toolsimportuse_browseragent=Agent(tools=[use_browser])
# Simple navigationresult=agent.tool.use_browser(action="navigate", url="https://example.com")
# Sequential actions for form fillingresult=agent.tool.use_browser(actions=[
{"action": "navigate", "args": {"url": "https://example.com/login"}},
{"action": "type", "args": {"selector": "#username", "text": "user@example.com"}},
{"action": "click", "args": {"selector": "#submit"}}
])
# Web scraping with content extractionresult=agent.tool.use_browser(actions=[
{"action": "navigate", "args": {"url": "https://example.com/data"}},
{"action": "get_text", "args": {"selector": ".content"}},
{"action": "click", "args": {"selector": ".next-page"}},
{"action": "get_html", "args": {"selector": "main"}}
])

Handoff to User

fromstrandsimportAgentfromstrands_toolsimporthandoff_to_useragent=Agent(tools=[handoff_to_user])
# Request user confirmation and continueresponse=agent.tool.handoff_to_user(
message="I need your approval to proceed with deleting these files. 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 and take any necessary follow-up actions.",
breakout_of_loop=True
)

A2A Client

fromstrandsimportAgentfromstrands_tools.a2a_clientimportA2AClientToolProvider# Initialize the A2A client provider with known agent URLsprovider=A2AClientToolProvider(known_agent_urls=["http://localhost:9000"])
agent=Agent(tools=provider.tools)
# Use natural language to interact with A2A agentsresponse=agent("discover available agents and send a greeting message")
# The agent will automatically use the available tools:# - discover_agent(url) to find agents# - list_discovered_agents() to see all discovered agents# - send_message(message_text, target_agent_url) to communicate

🌍 Environment Variables Configuration

Agents Tools provides extensive customization through environment variables. This allows you to configure tool behavior without modifying code, making it ideal for different environments (development, testing, production).

Global Environment Variables

These variables affect multiple tools:

Environment VariableDescriptionDefaultAffected Tools
BYPASS_TOOL_CONSENTBypass consent for tool invocation, set to "true" to enablefalseAll tools that require consent (e.g. shell, file_write, python_repl)
STRANDS_TOOL_CONSOLE_MODEEnable rich UI for tools, set to "enabled" to enabledisabledAll tools that have optional rich UI
AWS_REGIONDefault AWS region for AWS operationsus-west-2use_aws, retrieve, generate_image, memory, nova_reels
AWS_PROFILEAWS profile name to use from ~/.aws/credentialsdefaultuse_aws, retrieve
LOG_LEVELLogging level (DEBUG, INFO, WARNING, ERROR)INFOAll tools

Tool-Specific Environment Variables

Calculator Tool

Environment VariableDescriptionDefault
CALCULATOR_MODEDefault calculation modeevaluate
CALCULATOR_PRECISIONNumber of decimal places for results10
CALCULATOR_SCIENTIFICWhether to use scientific notation for numbersFalse
CALCULATOR_FORCE_NUMERICForce numeric evaluation of symbolic expressionsFalse
CALCULATOR_FORCE_SCIENTIFIC_THRESHOLDThreshold for automatic scientific notation1e21
CALCULATOR_DERIVE_ORDERDefault order for derivatives1
CALCULATOR_SERIES_POINTDefault point for series expansion0
CALCULATOR_SERIES_ORDERDefault order for series expansion5

Current Time Tool

Environment VariableDescriptionDefault
DEFAULT_TIMEZONEDefault timezone for current_time toolUTC

Sleep Tool

Environment VariableDescriptionDefault
MAX_SLEEP_SECONDSMaximum allowed sleep duration in seconds300

Mem0 Memory Tool

The Mem0 Memory Tool supports three different backend configurations:

  1. Mem0 Platform:

    • Uses the Mem0 Platform API for memory management
    • Requires a Mem0 API key
  2. OpenSearch (Recommended for AWS environments):

    • Uses OpenSearch as the vector store backend
    • Requires AWS credentials and OpenSearch configuration
  3. FAISS (Default for local development):

    • Uses FAISS as the local vector store backend
    • Requires faiss-cpu package for local vector storage
Environment VariableDescriptionDefaultRequired For
MEM0_API_KEYMem0 Platform API keyNoneMem0 Platform
OPENSEARCH_HOSTOpenSearch Host URLNoneOpenSearch
AWS_REGIONAWS Region for OpenSearchus-west-2OpenSearch
DEVEnable development mode (bypasses confirmations)falseAll modes

Note:

  • If MEM0_API_KEY is set, the tool will use the Mem0 Platform
  • If OPENSEARCH_HOST is set, the tool will use OpenSearch
  • If neither is set, the tool will default to FAISS (requires faiss-cpu package)

Memory Tool

Environment VariableDescriptionDefault
MEMORY_DEFAULT_MAX_RESULTSDefault maximum results for list operations50
MEMORY_DEFAULT_MIN_SCOREDefault minimum relevance score for filtering results0.4

Nova Reels Tool

Environment VariableDescriptionDefault
NOVA_REEL_DEFAULT_SEEDDefault seed for video generation0
NOVA_REEL_DEFAULT_FPSDefault frames per second for generated videos24
NOVA_REEL_DEFAULT_DIMENSIONDefault video resolution in WIDTHxHEIGHT format1280x720
NOVA_REEL_DEFAULT_MAX_RESULTSDefault maximum number of jobs to return for list action10

Python REPL Tool

Environment VariableDescriptionDefault
PYTHON_REPL_BINARY_MAX_LENMaximum length for binary content before truncation100

Shell Tool

Environment VariableDescriptionDefault
SHELL_DEFAULT_TIMEOUTDefault timeout in seconds for shell commands900

Slack Tool

Environment VariableDescriptionDefault
SLACK_DEFAULT_EVENT_COUNTDefault number of events to retrieve42
STRANDS_SLACK_AUTO_REPLYEnable automatic replies to messagesfalse
STRANDS_SLACK_LISTEN_ONLY_TAGOnly process messages containing this tagNone

Speak Tool

Environment VariableDescriptionDefault
SPEAK_DEFAULT_STYLEDefault style for status messagesgreen
SPEAK_DEFAULT_MODEDefault speech mode (fast/polly)fast
SPEAK_DEFAULT_VOICE_IDDefault Polly voice IDJoanna
SPEAK_DEFAULT_OUTPUT_PATHDefault audio output pathspeech_output.mp3
SPEAK_DEFAULT_PLAY_AUDIOWhether to play audio by defaultTrue

Editor Tool

Environment VariableDescriptionDefault
EDITOR_DIR_TREE_MAX_DEPTHMaximum depth for directory tree visualization2
EDITOR_DEFAULT_STYLEDefault style for output panelsdefault
EDITOR_DEFAULT_LANGUAGEDefault language for syntax highlightingpython

Environment Tool

Environment VariableDescriptionDefault
ENV_VARS_MASKED_DEFAULTDefault setting for masking sensitive valuestrue

File Read Tool

Environment VariableDescriptionDefault
FILE_READ_RECURSIVE_DEFAULTDefault setting for recursive file searchingtrue
FILE_READ_CONTEXT_LINES_DEFAULTDefault number of context lines around search matches2
FILE_READ_START_LINE_DEFAULTDefault starting line number for lines mode0
FILE_READ_CHUNK_OFFSET_DEFAULTDefault byte offset for chunk mode0
FILE_READ_DIFF_TYPE_DEFAULTDefault diff type for file comparisonsunified
FILE_READ_USE_GIT_DEFAULTDefault setting for using git in time machine modetrue
FILE_READ_NUM_REVISIONS_DEFAULTDefault number of revisions to show in time machine mode5

Use Browser Tool

Environment VariableDescriptionDefault
STRANDS_DEFAULT_WAIT_TIMEDefault setting for wait time with actions1
STRANDS_BROWSER_MAX_RETRIESDefault number of retries to perform when an action fails3
STRANDS_BROWSER_RETRY_DELAYDefault retry delay time for retry mechanisms1
STRANDS_BROWSER_SCREENSHOTS_DIRDefault directory where screenshots will be savedscreenshots
STRANDS_BROWSER_USER_DATA_DIRDefault directory where data for reloading a browser instance is stored~/.browser_automation
STRANDS_BROWSER_HEADLESSDefault headless setting for launching browsersfalse
STRANDS_BROWSER_WIDTHDefault width of the browser1280
STRANDS_BROWSER_HEIGHTDefault height of the browser800

Contributing ❤️

This is a community-driven project, powered by passionate developers like you. We enthusiastically welcome contributions from everyone, regardless of experience level—your unique perspective is valuable to us!

How to Get Started?

  1. Find your first opportunity: If you're new to the project, explore our labeled "good first issues" for beginner-friendly tasks.
  2. Understand our workflow: Review our Contributing Guide to learn about our development setup, coding standards, and pull request process.
  3. Make your impact: Contributions come in many forms—fixing bugs, enhancing documentation, improving performance, adding features, writing tests, or refining the user experience.
  4. Submit your work: When you're ready, submit a well-documented pull request, and our maintainers will provide feedback to help get your changes merged.

Your questions, insights, and ideas are always welcome!

Together, we're building something meaningful that impacts real users. We look forward to collaborating with you!

License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

Security

See CONTRIBUTING for more information.

About

A set of tools that gives agents powerful capabilities.

Resources

Code of conduct

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Repository files navigation

Strands Agents

Strands Agents Tools

A model-driven approach to building AI agents in just a few lines of code.

GitHub commit activityGitHub open issuesGitHub open pull requestsLicensePyPI versionPython versions

DocumentationSamplesPython SDKToolsAgent BuilderMCP Server

Strands Agents Tools provides a powerful set of tools for your agents to use. It bridges the gap between large language models and practical applications by offering ready-to-use tools for file operations, system execution, API interactions, mathematical operations, and more.

✨ Features

  • 📁 File Operations - Read, write, and edit files with syntax highlighting and intelligent modifications
  • 🖥️ Shell Integration - Execute and interact with shell commands securely
  • 🧠 Memory - Store user and agent memories across agent runs to provide personalized experiences with both Mem0 and Amazon Bedrock Knowledge Bases
  • 🌐 HTTP Client - Make API requests with comprehensive authentication support
  • 💬 Slack Client - Real-time Slack events, message processing, and Slack API access
  • 🐍 Python Execution - Run Python code snippets with state persistence, user confirmation for code execution, and safety features
  • 🧮 Mathematical Tools - Perform advanced calculations with symbolic math capabilities
  • ☁️ AWS Integration - Seamless access to AWS services
  • 🖼️ Image Processing - Generate and process images for AI applications
  • 🎥 Video Processing - Use models and agents to generate dynamic videos
  • 🎙️ Audio Output - Enable models to generate audio and speak
  • 🔄 Environment Management - Handle environment variables safely
  • 📝 Journaling - Create and manage structured logs and journals
  • ⏱️ Task Scheduling - Schedule and manage cron jobs
  • 🧠 Advanced Reasoning - Tools for complex thinking and reasoning capabilities
  • 🐝 Swarm Intelligence - Coordinate multiple AI agents for parallel problem solving with shared memory
  • 🔄 Multiple tools in Parallel - Call multiple other tools at the same time in parallel with Batch Tool
  • 🔍 Browser Tool - Tool giving an agent access to perform automated actions on a browser (chromium)

📦 Installation

Quick Install

pip install strands-agents-tools

To install the dependencies for optional tools:

pip install strands-agents-tools[mem0_memory, use_browser]

Development Install

# Clone the repository
git clone https://github.com/strands-agents/tools.git
cd tools
# Create and activate virtual environment
python3 -m venv .venv
source .venv/bin/activate # On Windows: venv\Scripts\activate# Install in development mode
pip install -e ".[dev]"# Install pre-commit hooks
pre-commit install

Tools Overview

Below is a comprehensive table of all available tools, how to use them with an agent, and typical use cases:

ToolAgent UsageUse Case
a2a_clientprovider = A2AClientToolProvider(known_agent_urls=["http://localhost:9000"]); agent = Agent(tools=provider.tools)Discover and communicate with A2A-compliant agents, send messages between agents
file_readagent.tool.file_read(path="path/to/file.txt")Reading configuration files, parsing code files, loading datasets
file_writeagent.tool.file_write(path="path/to/file.txt", content="file content")Writing results to files, creating new files, saving output data
editoragent.tool.editor(command="view", path="path/to/file.py")Advanced file operations like syntax highlighting, pattern replacement, and multi-file edits
shell*agent.tool.shell(command="ls -la")Executing shell commands, interacting with the operating system, running scripts
http_requestagent.tool.http_request(method="GET", url="https://api.example.com/data")Making API calls, fetching web data, sending data to external services
python_repl*agent.tool.python_repl(code="import pandas as pd\ndf = pd.read_csv('data.csv')\nprint(df.head())")Running Python code snippets, data analysis, executing complex logic with user confirmation for security
calculatoragent.tool.calculator(expression="2 * sin(pi/4) + log(e**2)")Performing mathematical operations, symbolic math, equation solving
use_awsagent.tool.use_aws(service_name="s3", operation_name="list_buckets", parameters={}, region="us-west-2")Interacting with AWS services, cloud resource management
retrieveagent.tool.retrieve(text="What is STRANDS?")Retrieving information from Amazon Bedrock Knowledge Bases
nova_reelsagent.tool.nova_reels(action="create", text="A cinematic shot of mountains", s3_bucket="my-bucket")Create high-quality videos using Amazon Bedrock Nova Reel with configurable parameters via environment variables
mem0_memoryagent.tool.mem0_memory(action="store", content="Remember I like to play tennis", user_id="alex")Store user and agent memories across agent runs to provide personalized experience
memoryagent.tool.memory(action="retrieve", query="product features")Store, retrieve, list, and manage documents in Amazon Bedrock Knowledge Bases with configurable parameters via environment variables
environmentagent.tool.environment(action="list", prefix="AWS_")Managing environment variables, configuration management
generate_image_stabilityagent.tool.generate_image_stability(prompt="A tranquil pool")Creating images using Stability AI models
generate_imageagent.tool.generate_image(prompt="A sunset over mountains")Creating AI-generated images for various applications
image_readeragent.tool.image_reader(image_path="path/to/image.jpg")Processing and reading image files for AI analysis
journalagent.tool.journal(action="write", content="Today's progress notes")Creating structured logs, maintaining documentation
thinkagent.tool.think(thought="Complex problem to analyze", cycle_count=3)Advanced reasoning, multi-step thinking processes
load_toolagent.tool.load_tool(path="path/to/custom_tool.py", name="custom_tool")Dynamically loading custom tools and extensions
swarmagent.tool.swarm(task="Analyze this problem", swarm_size=3, coordination_pattern="collaborative")Coordinating multiple AI agents to solve complex problems through collective intelligence
current_timeagent.tool.current_time(timezone="US/Pacific")Get the current time in ISO 8601 format for a specified timezone
sleepagent.tool.sleep(seconds=5)Pause execution for the specified number of seconds, interruptible with SIGINT (Ctrl+C)
agent_graphagent.tool.agent_graph(agents=["agent1", "agent2"], connections=[{"from": "agent1", "to": "agent2"}])Create and visualize agent relationship graphs for complex multi-agent systems
cron*agent.tool.cron(action="schedule", name="task", schedule="0 * * * *", command="backup.sh")Schedule and manage recurring tasks with cron job syntax
**Does not work on Windows
slackagent.tool.slack(action="post_message", channel="general", text="Hello team!")Interact with Slack workspace for messaging and monitoring
speakagent.tool.speak(text="Operation completed successfully", style="green", mode="polly")Output status messages with rich formatting and optional text-to-speech
stopagent.tool.stop(message="Process terminated by user request")Gracefully terminate agent execution with custom message
handoff_to_useragent.tool.handoff_to_user(message="Please confirm action", breakout_of_loop=False)Hand off control to user for confirmation, input, or complete task handoff
use_llmagent.tool.use_llm(prompt="Analyze this data", system_prompt="You are a data analyst")Create nested AI loops with customized system prompts for specialized tasks
workflowagent.tool.workflow(action="create", name="data_pipeline", steps=[{"tool": "file_read"}, {"tool": "python_repl"}])Define, execute, and manage multi-step automated workflows
batchagent.tool.batch(invocations=[{"name": "current_time", "arguments": {"timezone": "Europe/London"}}, {"name": "stop", "arguments": {}}])Call multiple other tools in parallel.
use_browseragent.tool.use_browser(action="navigate", url="https://www.example.com") Web scraping, automated testing, form filling, web automation tasks

* These tools do not work on windows

💻 Usage Examples

File Operations

fromstrandsimportAgentfromstrands_toolsimportfile_read, file_write, editoragent=Agent(tools=[file_read, file_write, editor])
agent.tool.file_read(path="config.json")
agent.tool.file_write(path="output.txt", content="Hello, world!")
agent.tool.editor(command="view", path="script.py")

Shell Commands

Note: shell does not work on Windows.

fromstrandsimportAgentfromstrands_toolsimportshellagent=Agent(tools=[shell])
# Execute a single commandresult=agent.tool.shell(command="ls -la")
# Execute a sequence of commandsresults=agent.tool.shell(command=["mkdir -p test_dir", "cd test_dir", "touch test.txt"])
# Execute commands with error handlingagent.tool.shell(command="risky-command", ignore_errors=True)

HTTP Requests

fromstrandsimportAgentfromstrands_toolsimporthttp_requestagent=Agent(tools=[http_request])
# Make a simple GET requestresponse=agent.tool.http_request(
method="GET",
url="https://api.example.com/data"
)
# POST request with authenticationresponse=agent.tool.http_request(
method="POST",
url="https://api.example.com/resource",
headers={"Content-Type": "application/json"},
body=json.dumps({"key": "value"}),
auth_type="Bearer",
auth_token="your_token_here"
)
# Convert HTML webpages to markdown for better readabilityresponse=agent.tool.http_request(
method="GET",
url="https://example.com/article",
convert_to_markdown=True
)

Python Code Execution

Note: python_repl does not work on Windows.

fromstrandsimportAgentfromstrands_toolsimportpython_replagent=Agent(tools=[python_repl])
# Execute Python code with state persistenceresult=agent.tool.python_repl(code="""import pandas as pd# Load and process datadata = pd.read_csv('data.csv')processed = data.groupby('category').mean()processed.head()""")

Swarm Intelligence

fromstrandsimportAgentfromstrands_toolsimportswarmagent=Agent(tools=[swarm])
# Create a collaborative swarm of agents to tackle a complex problemresult=agent.tool.swarm(
task="Generate creative solutions for reducing plastic waste in urban areas",
swarm_size=5,
coordination_pattern="collaborative"
)
# Create a competitive swarm for diverse solution generationresult=agent.tool.swarm(
task="Design an innovative product for smart home automation",
swarm_size=3,
coordination_pattern="competitive"
)
# Hybrid approach combining collaboration and competitionresult=agent.tool.swarm(
task="Develop marketing strategies for a new sustainable fashion brand",
swarm_size=4,
coordination_pattern="hybrid"
)

Use AWS

fromstrandsimportAgentfromstrands_toolsimportuse_awsagent=Agent(tools=[use_aws])
# List S3 bucketsresult=agent.tool.use_aws(
service_name="s3",
operation_name="list_buckets",
parameters={},
region="us-east-1",
label="List all S3 buckets"
)
# Get the contents of a specific S3 bucketresult=agent.tool.use_aws(
service_name="s3",
operation_name="list_objects_v2",
parameters={"Bucket": "example-bucket"}, # Replace with your actual bucket nameregion="us-east-1",
label="List objects in a specific S3 bucket"
)
# Get the list of EC2 subnetsresult=agent.tool.use_aws(
service_name="ec2",
operation_name="describe_subnets",
parameters={},
region="us-east-1",
label="List all subnets"
)

Batch Tool

importosimportsysfromstrandsimportAgentfromstrands_toolsimportbatch, http_request, use_aws# Example usage of the batch with http_request and use_aws toolsagent=Agent(tools=[batch, http_request, use_aws])
result=agent.tool.batch(
invocations=[
{"name": "http_request", "arguments": {"method": "GET", "url": "https://api.ipify.org?format=json"}},
{
"name": "use_aws",
"arguments": {
"service_name": "s3",
"operation_name": "list_buckets",
"parameters": {},
"region": "us-east-1",
"label": "List S3 Buckets"
}
},
]
)

Use Browser

fromstrandsimportAgentfromstrands_toolsimportuse_browseragent=Agent(tools=[use_browser])
# Simple navigationresult=agent.tool.use_browser(action="navigate", url="https://example.com")
# Sequential actions for form fillingresult=agent.tool.use_browser(actions=[
{"action": "navigate", "args": {"url": "https://example.com/login"}},
{"action": "type", "args": {"selector": "#username", "text": "user@example.com"}},
{"action": "click", "args": {"selector": "#submit"}}
])
# Web scraping with content extractionresult=agent.tool.use_browser(actions=[
{"action": "navigate", "args": {"url": "https://example.com/data"}},
{"action": "get_text", "args": {"selector": ".content"}},
{"action": "click", "args": {"selector": ".next-page"}},
{"action": "get_html", "args": {"selector": "main"}}
])

Handoff to User

fromstrandsimportAgentfromstrands_toolsimporthandoff_to_useragent=Agent(tools=[handoff_to_user])
# Request user confirmation and continueresponse=agent.tool.handoff_to_user(
message="I need your approval to proceed with deleting these files. 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 and take any necessary follow-up actions.",
breakout_of_loop=True
)

A2A Client

fromstrandsimportAgentfromstrands_tools.a2a_clientimportA2AClientToolProvider# Initialize the A2A client provider with known agent URLsprovider=A2AClientToolProvider(known_agent_urls=["http://localhost:9000"])
agent=Agent(tools=provider.tools)
# Use natural language to interact with A2A agentsresponse=agent("discover available agents and send a greeting message")
# The agent will automatically use the available tools:# - discover_agent(url) to find agents# - list_discovered_agents() to see all discovered agents# - send_message(message_text, target_agent_url) to communicate

🌍 Environment Variables Configuration

Agents Tools provides extensive customization through environment variables. This allows you to configure tool behavior without modifying code, making it ideal for different environments (development, testing, production).

Global Environment Variables

These variables affect multiple tools:

Environment VariableDescriptionDefaultAffected Tools
BYPASS_TOOL_CONSENTBypass consent for tool invocation, set to "true" to enablefalseAll tools that require consent (e.g. shell, file_write, python_repl)
STRANDS_TOOL_CONSOLE_MODEEnable rich UI for tools, set to "enabled" to enabledisabledAll tools that have optional rich UI
AWS_REGIONDefault AWS region for AWS operationsus-west-2use_aws, retrieve, generate_image, memory, nova_reels
AWS_PROFILEAWS profile name to use from ~/.aws/credentialsdefaultuse_aws, retrieve
LOG_LEVELLogging level (DEBUG, INFO, WARNING, ERROR)INFOAll tools

Tool-Specific Environment Variables

Calculator Tool

Environment VariableDescriptionDefault
CALCULATOR_MODEDefault calculation modeevaluate
CALCULATOR_PRECISIONNumber of decimal places for results10
CALCULATOR_SCIENTIFICWhether to use scientific notation for numbersFalse
CALCULATOR_FORCE_NUMERICForce numeric evaluation of symbolic expressionsFalse
CALCULATOR_FORCE_SCIENTIFIC_THRESHOLDThreshold for automatic scientific notation1e21
CALCULATOR_DERIVE_ORDERDefault order for derivatives1
CALCULATOR_SERIES_POINTDefault point for series expansion0
CALCULATOR_SERIES_ORDERDefault order for series expansion5

Current Time Tool

Environment VariableDescriptionDefault
DEFAULT_TIMEZONEDefault timezone for current_time toolUTC

Sleep Tool

Environment VariableDescriptionDefault
MAX_SLEEP_SECONDSMaximum allowed sleep duration in seconds300

Mem0 Memory Tool

The Mem0 Memory Tool supports three different backend configurations:

  1. Mem0 Platform:

    • Uses the Mem0 Platform API for memory management
    • Requires a Mem0 API key
  2. OpenSearch (Recommended for AWS environments):

    • Uses OpenSearch as the vector store backend
    • Requires AWS credentials and OpenSearch configuration
  3. FAISS (Default for local development):

    • Uses FAISS as the local vector store backend
    • Requires faiss-cpu package for local vector storage
Environment VariableDescriptionDefaultRequired For
MEM0_API_KEYMem0 Platform API keyNoneMem0 Platform
OPENSEARCH_HOSTOpenSearch Host URLNoneOpenSearch
AWS_REGIONAWS Region for OpenSearchus-west-2OpenSearch
DEVEnable development mode (bypasses confirmations)falseAll modes

Note:

  • If MEM0_API_KEY is set, the tool will use the Mem0 Platform
  • If OPENSEARCH_HOST is set, the tool will use OpenSearch
  • If neither is set, the tool will default to FAISS (requires faiss-cpu package)

Memory Tool

Environment VariableDescriptionDefault
MEMORY_DEFAULT_MAX_RESULTSDefault maximum results for list operations50
MEMORY_DEFAULT_MIN_SCOREDefault minimum relevance score for filtering results0.4

Nova Reels Tool

Environment VariableDescriptionDefault
NOVA_REEL_DEFAULT_SEEDDefault seed for video generation0
NOVA_REEL_DEFAULT_FPSDefault frames per second for generated videos24
NOVA_REEL_DEFAULT_DIMENSIONDefault video resolution in WIDTHxHEIGHT format1280x720
NOVA_REEL_DEFAULT_MAX_RESULTSDefault maximum number of jobs to return for list action10

Python REPL Tool

Environment VariableDescriptionDefault
PYTHON_REPL_BINARY_MAX_LENMaximum length for binary content before truncation100

Shell Tool

Environment VariableDescriptionDefault
SHELL_DEFAULT_TIMEOUTDefault timeout in seconds for shell commands900

Slack Tool

Environment VariableDescriptionDefault
SLACK_DEFAULT_EVENT_COUNTDefault number of events to retrieve42
STRANDS_SLACK_AUTO_REPLYEnable automatic replies to messagesfalse
STRANDS_SLACK_LISTEN_ONLY_TAGOnly process messages containing this tagNone

Speak Tool

Environment VariableDescriptionDefault
SPEAK_DEFAULT_STYLEDefault style for status messagesgreen
SPEAK_DEFAULT_MODEDefault speech mode (fast/polly)fast
SPEAK_DEFAULT_VOICE_IDDefault Polly voice IDJoanna
SPEAK_DEFAULT_OUTPUT_PATHDefault audio output pathspeech_output.mp3
SPEAK_DEFAULT_PLAY_AUDIOWhether to play audio by defaultTrue

Editor Tool

Environment VariableDescriptionDefault
EDITOR_DIR_TREE_MAX_DEPTHMaximum depth for directory tree visualization2
EDITOR_DEFAULT_STYLEDefault style for output panelsdefault
EDITOR_DEFAULT_LANGUAGEDefault language for syntax highlightingpython

Environment Tool

Environment VariableDescriptionDefault
ENV_VARS_MASKED_DEFAULTDefault setting for masking sensitive valuestrue

File Read Tool

Environment VariableDescriptionDefault
FILE_READ_RECURSIVE_DEFAULTDefault setting for recursive file searchingtrue
FILE_READ_CONTEXT_LINES_DEFAULTDefault number of context lines around search matches2
FILE_READ_START_LINE_DEFAULTDefault starting line number for lines mode0
FILE_READ_CHUNK_OFFSET_DEFAULTDefault byte offset for chunk mode0
FILE_READ_DIFF_TYPE_DEFAULTDefault diff type for file comparisonsunified
FILE_READ_USE_GIT_DEFAULTDefault setting for using git in time machine modetrue
FILE_READ_NUM_REVISIONS_DEFAULTDefault number of revisions to show in time machine mode5

Use Browser Tool

Environment VariableDescriptionDefault
STRANDS_DEFAULT_WAIT_TIMEDefault setting for wait time with actions1
STRANDS_BROWSER_MAX_RETRIESDefault number of retries to perform when an action fails3
STRANDS_BROWSER_RETRY_DELAYDefault retry delay time for retry mechanisms1
STRANDS_BROWSER_SCREENSHOTS_DIRDefault directory where screenshots will be savedscreenshots
STRANDS_BROWSER_USER_DATA_DIRDefault directory where data for reloading a browser instance is stored~/.browser_automation
STRANDS_BROWSER_HEADLESSDefault headless setting for launching browsersfalse
STRANDS_BROWSER_WIDTHDefault width of the browser1280
STRANDS_BROWSER_HEIGHTDefault height of the browser800

Contributing ❤️

This is a community-driven project, powered by passionate developers like you. We enthusiastically welcome contributions from everyone, regardless of experience level—your unique perspective is valuable to us!

How to Get Started?

  1. Find your first opportunity: If you're new to the project, explore our labeled "good first issues" for beginner-friendly tasks.
  2. Understand our workflow: Review our Contributing Guide to learn about our development setup, coding standards, and pull request process.
  3. Make your impact: Contributions come in many forms—fixing bugs, enhancing documentation, improving performance, adding features, writing tests, or refining the user experience.
  4. Submit your work: When you're ready, submit a well-documented pull request, and our maintainers will provide feedback to help get your changes merged.

Your questions, insights, and ideas are always welcome!

Together, we're building something meaningful that impacts real users. We look forward to collaborating with you!

License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

Security

See CONTRIBUTING for more information.

About

A set of tools that gives agents powerful capabilities.

Resources

Code of conduct

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content

Repository files navigation

Strands Agents

Strands Agents Tools

A model-driven approach to building AI agents in just a few lines of code.

GitHub commit activityGitHub open issuesGitHub open pull requestsLicensePyPI versionPython versions

DocumentationSamplesPython SDKToolsAgent BuilderMCP Server

Strands Agents Tools provides a powerful set of tools for your agents to use. It bridges the gap between large language models and practical applications by offering ready-to-use tools for file operations, system execution, API interactions, mathematical operations, and more.

✨ Features

  • 📁 File Operations - Read, write, and edit files with syntax highlighting and intelligent modifications
  • 🖥️ Shell Integration - Execute and interact with shell commands securely
  • 🧠 Memory - Store user and agent memories across agent runs to provide personalized experiences with both Mem0 and Amazon Bedrock Knowledge Bases
  • 🌐 HTTP Client - Make API requests with comprehensive authentication support
  • 💬 Slack Client - Real-time Slack events, message processing, and Slack API access
  • 🐍 Python Execution - Run Python code snippets with state persistence, user confirmation for code execution, and safety features
  • 🧮 Mathematical Tools - Perform advanced calculations with symbolic math capabilities
  • ☁️ AWS Integration - Seamless access to AWS services
  • 🖼️ Image Processing - Generate and process images for AI applications
  • 🎥 Video Processing - Use models and agents to generate dynamic videos
  • 🎙️ Audio Output - Enable models to generate audio and speak
  • 🔄 Environment Management - Handle environment variables safely
  • 📝 Journaling - Create and manage structured logs and journals
  • ⏱️ Task Scheduling - Schedule and manage cron jobs
  • 🧠 Advanced Reasoning - Tools for complex thinking and reasoning capabilities
  • 🐝 Swarm Intelligence - Coordinate multiple AI agents for parallel problem solving with shared memory
  • 🔄 Multiple tools in Parallel - Call multiple other tools at the same time in parallel with Batch Tool
  • 🔍 Browser Tool - Tool giving an agent access to perform automated actions on a browser (chromium)

📦 Installation

Quick Install

pip install strands-agents-tools

To install the dependencies for optional tools:

pip install strands-agents-tools[mem0_memory, use_browser]

Development Install

# Clone the repository
git clone https://github.com/strands-agents/tools.git
cd tools
# Create and activate virtual environment
python3 -m venv .venv
source .venv/bin/activate # On Windows: venv\Scripts\activate# Install in development mode
pip install -e ".[dev]"# Install pre-commit hooks
pre-commit install

Tools Overview

Below is a comprehensive table of all available tools, how to use them with an agent, and typical use cases:

ToolAgent UsageUse Case
a2a_clientprovider = A2AClientToolProvider(known_agent_urls=["http://localhost:9000"]); agent = Agent(tools=provider.tools)Discover and communicate with A2A-compliant agents, send messages between agents
file_readagent.tool.file_read(path="path/to/file.txt")Reading configuration files, parsing code files, loading datasets
file_writeagent.tool.file_write(path="path/to/file.txt", content="file content")Writing results to files, creating new files, saving output data
editoragent.tool.editor(command="view", path="path/to/file.py")Advanced file operations like syntax highlighting, pattern replacement, and multi-file edits
shell*agent.tool.shell(command="ls -la")Executing shell commands, interacting with the operating system, running scripts
http_requestagent.tool.http_request(method="GET", url="https://api.example.com/data")Making API calls, fetching web data, sending data to external services
python_repl*agent.tool.python_repl(code="import pandas as pd\ndf = pd.read_csv('data.csv')\nprint(df.head())")Running Python code snippets, data analysis, executing complex logic with user confirmation for security
calculatoragent.tool.calculator(expression="2 * sin(pi/4) + log(e**2)")Performing mathematical operations, symbolic math, equation solving
use_awsagent.tool.use_aws(service_name="s3", operation_name="list_buckets", parameters={}, region="us-west-2")Interacting with AWS services, cloud resource management
retrieveagent.tool.retrieve(text="What is STRANDS?")Retrieving information from Amazon Bedrock Knowledge Bases
nova_reelsagent.tool.nova_reels(action="create", text="A cinematic shot of mountains", s3_bucket="my-bucket")Create high-quality videos using Amazon Bedrock Nova Reel with configurable parameters via environment variables
mem0_memoryagent.tool.mem0_memory(action="store", content="Remember I like to play tennis", user_id="alex")Store user and agent memories across agent runs to provide personalized experience
memoryagent.tool.memory(action="retrieve", query="product features")Store, retrieve, list, and manage documents in Amazon Bedrock Knowledge Bases with configurable parameters via environment variables
environmentagent.tool.environment(action="list", prefix="AWS_")Managing environment variables, configuration management
generate_image_stabilityagent.tool.generate_image_stability(prompt="A tranquil pool")Creating images using Stability AI models
generate_imageagent.tool.generate_image(prompt="A sunset over mountains")Creating AI-generated images for various applications
image_readeragent.tool.image_reader(image_path="path/to/image.jpg")Processing and reading image files for AI analysis
journalagent.tool.journal(action="write", content="Today's progress notes")Creating structured logs, maintaining documentation
thinkagent.tool.think(thought="Complex problem to analyze", cycle_count=3)Advanced reasoning, multi-step thinking processes
load_toolagent.tool.load_tool(path="path/to/custom_tool.py", name="custom_tool")Dynamically loading custom tools and extensions
swarmagent.tool.swarm(task="Analyze this problem", swarm_size=3, coordination_pattern="collaborative")Coordinating multiple AI agents to solve complex problems through collective intelligence
current_timeagent.tool.current_time(timezone="US/Pacific")Get the current time in ISO 8601 format for a specified timezone
sleepagent.tool.sleep(seconds=5)Pause execution for the specified number of seconds, interruptible with SIGINT (Ctrl+C)
agent_graphagent.tool.agent_graph(agents=["agent1", "agent2"], connections=[{"from": "agent1", "to": "agent2"}])Create and visualize agent relationship graphs for complex multi-agent systems
cron*agent.tool.cron(action="schedule", name="task", schedule="0 * * * *", command="backup.sh")Schedule and manage recurring tasks with cron job syntax
**Does not work on Windows
slackagent.tool.slack(action="post_message", channel="general", text="Hello team!")Interact with Slack workspace for messaging and monitoring
speakagent.tool.speak(text="Operation completed successfully", style="green", mode="polly")Output status messages with rich formatting and optional text-to-speech
stopagent.tool.stop(message="Process terminated by user request")Gracefully terminate agent execution with custom message
handoff_to_useragent.tool.handoff_to_user(message="Please confirm action", breakout_of_loop=False)Hand off control to user for confirmation, input, or complete task handoff
use_llmagent.tool.use_llm(prompt="Analyze this data", system_prompt="You are a data analyst")Create nested AI loops with customized system prompts for specialized tasks
workflowagent.tool.workflow(action="create", name="data_pipeline", steps=[{"tool": "file_read"}, {"tool": "python_repl"}])Define, execute, and manage multi-step automated workflows
batchagent.tool.batch(invocations=[{"name": "current_time", "arguments": {"timezone": "Europe/London"}}, {"name": "stop", "arguments": {}}])Call multiple other tools in parallel.
use_browseragent.tool.use_browser(action="navigate", url="https://www.example.com") Web scraping, automated testing, form filling, web automation tasks

* These tools do not work on windows

💻 Usage Examples

File Operations

fromstrandsimportAgentfromstrands_toolsimportfile_read, file_write, editoragent=Agent(tools=[file_read, file_write, editor])
agent.tool.file_read(path="config.json")
agent.tool.file_write(path="output.txt", content="Hello, world!")
agent.tool.editor(command="view", path="script.py")

Shell Commands

Note: shell does not work on Windows.

fromstrandsimportAgentfromstrands_toolsimportshellagent=Agent(tools=[shell])
# Execute a single commandresult=agent.tool.shell(command="ls -la")
# Execute a sequence of commandsresults=agent.tool.shell(command=["mkdir -p test_dir", "cd test_dir", "touch test.txt"])
# Execute commands with error handlingagent.tool.shell(command="risky-command", ignore_errors=True)

HTTP Requests

fromstrandsimportAgentfromstrands_toolsimporthttp_requestagent=Agent(tools=[http_request])
# Make a simple GET requestresponse=agent.tool.http_request(
method="GET",
url="https://api.example.com/data"
)
# POST request with authenticationresponse=agent.tool.http_request(
method="POST",
url="https://api.example.com/resource",
headers={"Content-Type": "application/json"},
body=json.dumps({"key": "value"}),
auth_type="Bearer",
auth_token="your_token_here"
)
# Convert HTML webpages to markdown for better readabilityresponse=agent.tool.http_request(
method="GET",
url="https://example.com/article",
convert_to_markdown=True
)

Python Code Execution

Note: python_repl does not work on Windows.

fromstrandsimportAgentfromstrands_toolsimportpython_replagent=Agent(tools=[python_repl])
# Execute Python code with state persistenceresult=agent.tool.python_repl(code="""import pandas as pd# Load and process datadata = pd.read_csv('data.csv')processed = data.groupby('category').mean()processed.head()""")

Swarm Intelligence

fromstrandsimportAgentfromstrands_toolsimportswarmagent=Agent(tools=[swarm])
# Create a collaborative swarm of agents to tackle a complex problemresult=agent.tool.swarm(
task="Generate creative solutions for reducing plastic waste in urban areas",
swarm_size=5,
coordination_pattern="collaborative"
)
# Create a competitive swarm for diverse solution generationresult=agent.tool.swarm(
task="Design an innovative product for smart home automation",
swarm_size=3,
coordination_pattern="competitive"
)
# Hybrid approach combining collaboration and competitionresult=agent.tool.swarm(
task="Develop marketing strategies for a new sustainable fashion brand",
swarm_size=4,
coordination_pattern="hybrid"
)

Use AWS

fromstrandsimportAgentfromstrands_toolsimportuse_awsagent=Agent(tools=[use_aws])
# List S3 bucketsresult=agent.tool.use_aws(
service_name="s3",
operation_name="list_buckets",
parameters={},
region="us-east-1",
label="List all S3 buckets"
)
# Get the contents of a specific S3 bucketresult=agent.tool.use_aws(
service_name="s3",
operation_name="list_objects_v2",
parameters={"Bucket": "example-bucket"}, # Replace with your actual bucket nameregion="us-east-1",
label="List objects in a specific S3 bucket"
)
# Get the list of EC2 subnetsresult=agent.tool.use_aws(
service_name="ec2",
operation_name="describe_subnets",
parameters={},
region="us-east-1",
label="List all subnets"
)

Batch Tool

importosimportsysfromstrandsimportAgentfromstrands_toolsimportbatch, http_request, use_aws# Example usage of the batch with http_request and use_aws toolsagent=Agent(tools=[batch, http_request, use_aws])
result=agent.tool.batch(
invocations=[
{"name": "http_request", "arguments": {"method": "GET", "url": "https://api.ipify.org?format=json"}},
{
"name": "use_aws",
"arguments": {
"service_name": "s3",
"operation_name": "list_buckets",
"parameters": {},
"region": "us-east-1",
"label": "List S3 Buckets"
}
},
]
)

Use Browser

fromstrandsimportAgentfromstrands_toolsimportuse_browseragent=Agent(tools=[use_browser])
# Simple navigationresult=agent.tool.use_browser(action="navigate", url="https://example.com")
# Sequential actions for form fillingresult=agent.tool.use_browser(actions=[
{"action": "navigate", "args": {"url": "https://example.com/login"}},
{"action": "type", "args": {"selector": "#username", "text": "user@example.com"}},
{"action": "click", "args": {"selector": "#submit"}}
])
# Web scraping with content extractionresult=agent.tool.use_browser(actions=[
{"action": "navigate", "args": {"url": "https://example.com/data"}},
{"action": "get_text", "args": {"selector": ".content"}},
{"action": "click", "args": {"selector": ".next-page"}},
{"action": "get_html", "args": {"selector": "main"}}
])

Handoff to User

fromstrandsimportAgentfromstrands_toolsimporthandoff_to_useragent=Agent(tools=[handoff_to_user])
# Request user confirmation and continueresponse=agent.tool.handoff_to_user(
message="I need your approval to proceed with deleting these files. 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 and take any necessary follow-up actions.",
breakout_of_loop=True
)

A2A Client

fromstrandsimportAgentfromstrands_tools.a2a_clientimportA2AClientToolProvider# Initialize the A2A client provider with known agent URLsprovider=A2AClientToolProvider(known_agent_urls=["http://localhost:9000"])
agent=Agent(tools=provider.tools)
# Use natural language to interact with A2A agentsresponse=agent("discover available agents and send a greeting message")
# The agent will automatically use the available tools:# - discover_agent(url) to find agents# - list_discovered_agents() to see all discovered agents# - send_message(message_text, target_agent_url) to communicate

🌍 Environment Variables Configuration

Agents Tools provides extensive customization through environment variables. This allows you to configure tool behavior without modifying code, making it ideal for different environments (development, testing, production).

Global Environment Variables

These variables affect multiple tools:

Environment VariableDescriptionDefaultAffected Tools
BYPASS_TOOL_CONSENTBypass consent for tool invocation, set to "true" to enablefalseAll tools that require consent (e.g. shell, file_write, python_repl)
STRANDS_TOOL_CONSOLE_MODEEnable rich UI for tools, set to "enabled" to enabledisabledAll tools that have optional rich UI
AWS_REGIONDefault AWS region for AWS operationsus-west-2use_aws, retrieve, generate_image, memory, nova_reels
AWS_PROFILEAWS profile name to use from ~/.aws/credentialsdefaultuse_aws, retrieve
LOG_LEVELLogging level (DEBUG, INFO, WARNING, ERROR)INFOAll tools

Tool-Specific Environment Variables

Calculator Tool

Environment VariableDescriptionDefault
CALCULATOR_MODEDefault calculation modeevaluate
CALCULATOR_PRECISIONNumber of decimal places for results10
CALCULATOR_SCIENTIFICWhether to use scientific notation for numbersFalse
CALCULATOR_FORCE_NUMERICForce numeric evaluation of symbolic expressionsFalse
CALCULATOR_FORCE_SCIENTIFIC_THRESHOLDThreshold for automatic scientific notation1e21
CALCULATOR_DERIVE_ORDERDefault order for derivatives1
CALCULATOR_SERIES_POINTDefault point for series expansion0
CALCULATOR_SERIES_ORDERDefault order for series expansion5

Current Time Tool

Environment VariableDescriptionDefault
DEFAULT_TIMEZONEDefault timezone for current_time toolUTC

Sleep Tool

Environment VariableDescriptionDefault
MAX_SLEEP_SECONDSMaximum allowed sleep duration in seconds300

Mem0 Memory Tool

The Mem0 Memory Tool supports three different backend configurations:

  1. Mem0 Platform:

    • Uses the Mem0 Platform API for memory management
    • Requires a Mem0 API key
  2. OpenSearch (Recommended for AWS environments):

    • Uses OpenSearch as the vector store backend
    • Requires AWS credentials and OpenSearch configuration
  3. FAISS (Default for local development):

    • Uses FAISS as the local vector store backend
    • Requires faiss-cpu package for local vector storage
Environment VariableDescriptionDefaultRequired For
MEM0_API_KEYMem0 Platform API keyNoneMem0 Platform
OPENSEARCH_HOSTOpenSearch Host URLNoneOpenSearch
AWS_REGIONAWS Region for OpenSearchus-west-2OpenSearch
DEVEnable development mode (bypasses confirmations)falseAll modes

Note:

  • If MEM0_API_KEY is set, the tool will use the Mem0 Platform
  • If OPENSEARCH_HOST is set, the tool will use OpenSearch
  • If neither is set, the tool will default to FAISS (requires faiss-cpu package)

Memory Tool

Environment VariableDescriptionDefault
MEMORY_DEFAULT_MAX_RESULTSDefault maximum results for list operations50
MEMORY_DEFAULT_MIN_SCOREDefault minimum relevance score for filtering results0.4

Nova Reels Tool

Environment VariableDescriptionDefault
NOVA_REEL_DEFAULT_SEEDDefault seed for video generation0
NOVA_REEL_DEFAULT_FPSDefault frames per second for generated videos24
NOVA_REEL_DEFAULT_DIMENSIONDefault video resolution in WIDTHxHEIGHT format1280x720
NOVA_REEL_DEFAULT_MAX_RESULTSDefault maximum number of jobs to return for list action10

Python REPL Tool

Environment VariableDescriptionDefault
PYTHON_REPL_BINARY_MAX_LENMaximum length for binary content before truncation100

Shell Tool

Environment VariableDescriptionDefault
SHELL_DEFAULT_TIMEOUTDefault timeout in seconds for shell commands900

Slack Tool

Environment VariableDescriptionDefault
SLACK_DEFAULT_EVENT_COUNTDefault number of events to retrieve42
STRANDS_SLACK_AUTO_REPLYEnable automatic replies to messagesfalse
STRANDS_SLACK_LISTEN_ONLY_TAGOnly process messages containing this tagNone

Speak Tool

Environment VariableDescriptionDefault
SPEAK_DEFAULT_STYLEDefault style for status messagesgreen
SPEAK_DEFAULT_MODEDefault speech mode (fast/polly)fast
SPEAK_DEFAULT_VOICE_IDDefault Polly voice IDJoanna
SPEAK_DEFAULT_OUTPUT_PATHDefault audio output pathspeech_output.mp3
SPEAK_DEFAULT_PLAY_AUDIOWhether to play audio by defaultTrue

Editor Tool

Environment VariableDescriptionDefault
EDITOR_DIR_TREE_MAX_DEPTHMaximum depth for directory tree visualization2
EDITOR_DEFAULT_STYLEDefault style for output panelsdefault
EDITOR_DEFAULT_LANGUAGEDefault language for syntax highlightingpython

Environment Tool

Environment VariableDescriptionDefault
ENV_VARS_MASKED_DEFAULTDefault setting for masking sensitive valuestrue

File Read Tool

Environment VariableDescriptionDefault
FILE_READ_RECURSIVE_DEFAULTDefault setting for recursive file searchingtrue
FILE_READ_CONTEXT_LINES_DEFAULTDefault number of context lines around search matches2
FILE_READ_START_LINE_DEFAULTDefault starting line number for lines mode0
FILE_READ_CHUNK_OFFSET_DEFAULTDefault byte offset for chunk mode0
FILE_READ_DIFF_TYPE_DEFAULTDefault diff type for file comparisonsunified
FILE_READ_USE_GIT_DEFAULTDefault setting for using git in time machine modetrue
FILE_READ_NUM_REVISIONS_DEFAULTDefault number of revisions to show in time machine mode5

Use Browser Tool

Environment VariableDescriptionDefault
STRANDS_DEFAULT_WAIT_TIMEDefault setting for wait time with actions1
STRANDS_BROWSER_MAX_RETRIESDefault number of retries to perform when an action fails3
STRANDS_BROWSER_RETRY_DELAYDefault retry delay time for retry mechanisms1
STRANDS_BROWSER_SCREENSHOTS_DIRDefault directory where screenshots will be savedscreenshots
STRANDS_BROWSER_USER_DATA_DIRDefault directory where data for reloading a browser instance is stored~/.browser_automation
STRANDS_BROWSER_HEADLESSDefault headless setting for launching browsersfalse
STRANDS_BROWSER_WIDTHDefault width of the browser1280
STRANDS_BROWSER_HEIGHTDefault height of the browser800

Contributing ❤️

This is a community-driven project, powered by passionate developers like you. We enthusiastically welcome contributions from everyone, regardless of experience level—your unique perspective is valuable to us!

How to Get Started?

  1. Find your first opportunity: If you're new to the project, explore our labeled "good first issues" for beginner-friendly tasks.
  2. Understand our workflow: Review our Contributing Guide to learn about our development setup, coding standards, and pull request process.
  3. Make your impact: Contributions come in many forms—fixing bugs, enhancing documentation, improving performance, adding features, writing tests, or refining the user experience.
  4. Submit your work: When you're ready, submit a well-documented pull request, and our maintainers will provide feedback to help get your changes merged.

Your questions, insights, and ideas are always welcome!

Together, we're building something meaningful that impacts real users. We look forward to collaborating with you!

License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

Security

See CONTRIBUTING for more information.

About

A set of tools that gives agents powerful capabilities.

Resources

Code of conduct

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Repository files navigation

Strands Agents

Strands Agents Tools

A model-driven approach to building AI agents in just a few lines of code.

GitHub commit activityGitHub open issuesGitHub open pull requestsLicensePyPI versionPython versions

DocumentationSamplesPython SDKToolsAgent BuilderMCP Server

Strands Agents Tools provides a powerful set of tools for your agents to use. It bridges the gap between large language models and practical applications by offering ready-to-use tools for file operations, system execution, API interactions, mathematical operations, and more.

✨ Features

  • 📁 File Operations - Read, write, and edit files with syntax highlighting and intelligent modifications
  • 🖥️ Shell Integration - Execute and interact with shell commands securely
  • 🧠 Memory - Store user and agent memories across agent runs to provide personalized experiences with both Mem0 and Amazon Bedrock Knowledge Bases
  • 🌐 HTTP Client - Make API requests with comprehensive authentication support
  • 💬 Slack Client - Real-time Slack events, message processing, and Slack API access
  • 🐍 Python Execution - Run Python code snippets with state persistence, user confirmation for code execution, and safety features
  • 🧮 Mathematical Tools - Perform advanced calculations with symbolic math capabilities
  • ☁️ AWS Integration - Seamless access to AWS services
  • 🖼️ Image Processing - Generate and process images for AI applications
  • 🎥 Video Processing - Use models and agents to generate dynamic videos
  • 🎙️ Audio Output - Enable models to generate audio and speak
  • 🔄 Environment Management - Handle environment variables safely
  • 📝 Journaling - Create and manage structured logs and journals
  • ⏱️ Task Scheduling - Schedule and manage cron jobs
  • 🧠 Advanced Reasoning - Tools for complex thinking and reasoning capabilities
  • 🐝 Swarm Intelligence - Coordinate multiple AI agents for parallel problem solving with shared memory
  • 🔄 Multiple tools in Parallel - Call multiple other tools at the same time in parallel with Batch Tool
  • 🔍 Browser Tool - Tool giving an agent access to perform automated actions on a browser (chromium)

📦 Installation

Quick Install

pip install strands-agents-tools

To install the dependencies for optional tools:

pip install strands-agents-tools[mem0_memory, use_browser]

Development Install

# Clone the repository
git clone https://github.com/strands-agents/tools.git
cd tools
# Create and activate virtual environment
python3 -m venv .venv
source .venv/bin/activate # On Windows: venv\Scripts\activate# Install in development mode
pip install -e ".[dev]"# Install pre-commit hooks
pre-commit install

Tools Overview

Below is a comprehensive table of all available tools, how to use them with an agent, and typical use cases:

ToolAgent UsageUse Case
a2a_clientprovider = A2AClientToolProvider(known_agent_urls=["http://localhost:9000"]); agent = Agent(tools=provider.tools)Discover and communicate with A2A-compliant agents, send messages between agents
file_readagent.tool.file_read(path="path/to/file.txt")Reading configuration files, parsing code files, loading datasets
file_writeagent.tool.file_write(path="path/to/file.txt", content="file content")Writing results to files, creating new files, saving output data
editoragent.tool.editor(command="view", path="path/to/file.py")Advanced file operations like syntax highlighting, pattern replacement, and multi-file edits
shell*agent.tool.shell(command="ls -la")Executing shell commands, interacting with the operating system, running scripts
http_requestagent.tool.http_request(method="GET", url="https://api.example.com/data")Making API calls, fetching web data, sending data to external services
python_repl*agent.tool.python_repl(code="import pandas as pd\ndf = pd.read_csv('data.csv')\nprint(df.head())")Running Python code snippets, data analysis, executing complex logic with user confirmation for security
calculatoragent.tool.calculator(expression="2 * sin(pi/4) + log(e**2)")Performing mathematical operations, symbolic math, equation solving
use_awsagent.tool.use_aws(service_name="s3", operation_name="list_buckets", parameters={}, region="us-west-2")Interacting with AWS services, cloud resource management
retrieveagent.tool.retrieve(text="What is STRANDS?")Retrieving information from Amazon Bedrock Knowledge Bases
nova_reelsagent.tool.nova_reels(action="create", text="A cinematic shot of mountains", s3_bucket="my-bucket")Create high-quality videos using Amazon Bedrock Nova Reel with configurable parameters via environment variables
mem0_memoryagent.tool.mem0_memory(action="store", content="Remember I like to play tennis", user_id="alex")Store user and agent memories across agent runs to provide personalized experience
memoryagent.tool.memory(action="retrieve", query="product features")Store, retrieve, list, and manage documents in Amazon Bedrock Knowledge Bases with configurable parameters via environment variables
environmentagent.tool.environment(action="list", prefix="AWS_")Managing environment variables, configuration management
generate_image_stabilityagent.tool.generate_image_stability(prompt="A tranquil pool")Creating images using Stability AI models
generate_imageagent.tool.generate_image(prompt="A sunset over mountains")Creating AI-generated images for various applications
image_readeragent.tool.image_reader(image_path="path/to/image.jpg")Processing and reading image files for AI analysis
journalagent.tool.journal(action="write", content="Today's progress notes")Creating structured logs, maintaining documentation
thinkagent.tool.think(thought="Complex problem to analyze", cycle_count=3)Advanced reasoning, multi-step thinking processes
load_toolagent.tool.load_tool(path="path/to/custom_tool.py", name="custom_tool")Dynamically loading custom tools and extensions
swarmagent.tool.swarm(task="Analyze this problem", swarm_size=3, coordination_pattern="collaborative")Coordinating multiple AI agents to solve complex problems through collective intelligence
current_timeagent.tool.current_time(timezone="US/Pacific")Get the current time in ISO 8601 format for a specified timezone
sleepagent.tool.sleep(seconds=5)Pause execution for the specified number of seconds, interruptible with SIGINT (Ctrl+C)
agent_graphagent.tool.agent_graph(agents=["agent1", "agent2"], connections=[{"from": "agent1", "to": "agent2"}])Create and visualize agent relationship graphs for complex multi-agent systems
cron*agent.tool.cron(action="schedule", name="task", schedule="0 * * * *", command="backup.sh")Schedule and manage recurring tasks with cron job syntax
**Does not work on Windows
slackagent.tool.slack(action="post_message", channel="general", text="Hello team!")Interact with Slack workspace for messaging and monitoring
speakagent.tool.speak(text="Operation completed successfully", style="green", mode="polly")Output status messages with rich formatting and optional text-to-speech
stopagent.tool.stop(message="Process terminated by user request")Gracefully terminate agent execution with custom message
handoff_to_useragent.tool.handoff_to_user(message="Please confirm action", breakout_of_loop=False)Hand off control to user for confirmation, input, or complete task handoff
use_llmagent.tool.use_llm(prompt="Analyze this data", system_prompt="You are a data analyst")Create nested AI loops with customized system prompts for specialized tasks
workflowagent.tool.workflow(action="create", name="data_pipeline", steps=[{"tool": "file_read"}, {"tool": "python_repl"}])Define, execute, and manage multi-step automated workflows
batchagent.tool.batch(invocations=[{"name": "current_time", "arguments": {"timezone": "Europe/London"}}, {"name": "stop", "arguments": {}}])Call multiple other tools in parallel.
use_browseragent.tool.use_browser(action="navigate", url="https://www.example.com") Web scraping, automated testing, form filling, web automation tasks

* These tools do not work on windows

💻 Usage Examples

File Operations

fromstrandsimportAgentfromstrands_toolsimportfile_read, file_write, editoragent=Agent(tools=[file_read, file_write, editor])
agent.tool.file_read(path="config.json")
agent.tool.file_write(path="output.txt", content="Hello, world!")
agent.tool.editor(command="view", path="script.py")

Shell Commands

Note: shell does not work on Windows.

fromstrandsimportAgentfromstrands_toolsimportshellagent=Agent(tools=[shell])
# Execute a single commandresult=agent.tool.shell(command="ls -la")
# Execute a sequence of commandsresults=agent.tool.shell(command=["mkdir -p test_dir", "cd test_dir", "touch test.txt"])
# Execute commands with error handlingagent.tool.shell(command="risky-command", ignore_errors=True)

HTTP Requests

fromstrandsimportAgentfromstrands_toolsimporthttp_requestagent=Agent(tools=[http_request])
# Make a simple GET requestresponse=agent.tool.http_request(
method="GET",
url="https://api.example.com/data"
)
# POST request with authenticationresponse=agent.tool.http_request(
method="POST",
url="https://api.example.com/resource",
headers={"Content-Type": "application/json"},
body=json.dumps({"key": "value"}),
auth_type="Bearer",
auth_token="your_token_here"
)
# Convert HTML webpages to markdown for better readabilityresponse=agent.tool.http_request(
method="GET",
url="https://example.com/article",
convert_to_markdown=True
)

Python Code Execution

Note: python_repl does not work on Windows.

fromstrandsimportAgentfromstrands_toolsimportpython_replagent=Agent(tools=[python_repl])
# Execute Python code with state persistenceresult=agent.tool.python_repl(code="""import pandas as pd# Load and process datadata = pd.read_csv('data.csv')processed = data.groupby('category').mean()processed.head()""")

Swarm Intelligence

fromstrandsimportAgentfromstrands_toolsimportswarmagent=Agent(tools=[swarm])
# Create a collaborative swarm of agents to tackle a complex problemresult=agent.tool.swarm(
task="Generate creative solutions for reducing plastic waste in urban areas",
swarm_size=5,
coordination_pattern="collaborative"
)
# Create a competitive swarm for diverse solution generationresult=agent.tool.swarm(
task="Design an innovative product for smart home automation",
swarm_size=3,
coordination_pattern="competitive"
)
# Hybrid approach combining collaboration and competitionresult=agent.tool.swarm(
task="Develop marketing strategies for a new sustainable fashion brand",
swarm_size=4,
coordination_pattern="hybrid"
)

Use AWS

fromstrandsimportAgentfromstrands_toolsimportuse_awsagent=Agent(tools=[use_aws])
# List S3 bucketsresult=agent.tool.use_aws(
service_name="s3",
operation_name="list_buckets",
parameters={},
region="us-east-1",
label="List all S3 buckets"
)
# Get the contents of a specific S3 bucketresult=agent.tool.use_aws(
service_name="s3",
operation_name="list_objects_v2",
parameters={"Bucket": "example-bucket"}, # Replace with your actual bucket nameregion="us-east-1",
label="List objects in a specific S3 bucket"
)
# Get the list of EC2 subnetsresult=agent.tool.use_aws(
service_name="ec2",
operation_name="describe_subnets",
parameters={},
region="us-east-1",
label="List all subnets"
)

Batch Tool

importosimportsysfromstrandsimportAgentfromstrands_toolsimportbatch, http_request, use_aws# Example usage of the batch with http_request and use_aws toolsagent=Agent(tools=[batch, http_request, use_aws])
result=agent.tool.batch(
invocations=[
{"name": "http_request", "arguments": {"method": "GET", "url": "https://api.ipify.org?format=json"}},
{
"name": "use_aws",
"arguments": {
"service_name": "s3",
"operation_name": "list_buckets",
"parameters": {},
"region": "us-east-1",
"label": "List S3 Buckets"
}
},
]
)

Use Browser

fromstrandsimportAgentfromstrands_toolsimportuse_browseragent=Agent(tools=[use_browser])
# Simple navigationresult=agent.tool.use_browser(action="navigate", url="https://example.com")
# Sequential actions for form fillingresult=agent.tool.use_browser(actions=[
{"action": "navigate", "args": {"url": "https://example.com/login"}},
{"action": "type", "args": {"selector": "#username", "text": "user@example.com"}},
{"action": "click", "args": {"selector": "#submit"}}
])
# Web scraping with content extractionresult=agent.tool.use_browser(actions=[
{"action": "navigate", "args": {"url": "https://example.com/data"}},
{"action": "get_text", "args": {"selector": ".content"}},
{"action": "click", "args": {"selector": ".next-page"}},
{"action": "get_html", "args": {"selector": "main"}}
])

Handoff to User

fromstrandsimportAgentfromstrands_toolsimporthandoff_to_useragent=Agent(tools=[handoff_to_user])
# Request user confirmation and continueresponse=agent.tool.handoff_to_user(
message="I need your approval to proceed with deleting these files. 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 and take any necessary follow-up actions.",
breakout_of_loop=True
)

A2A Client

fromstrandsimportAgentfromstrands_tools.a2a_clientimportA2AClientToolProvider# Initialize the A2A client provider with known agent URLsprovider=A2AClientToolProvider(known_agent_urls=["http://localhost:9000"])
agent=Agent(tools=provider.tools)
# Use natural language to interact with A2A agentsresponse=agent("discover available agents and send a greeting message")
# The agent will automatically use the available tools:# - discover_agent(url) to find agents# - list_discovered_agents() to see all discovered agents# - send_message(message_text, target_agent_url) to communicate

🌍 Environment Variables Configuration

Agents Tools provides extensive customization through environment variables. This allows you to configure tool behavior without modifying code, making it ideal for different environments (development, testing, production).

Global Environment Variables

These variables affect multiple tools:

Environment VariableDescriptionDefaultAffected Tools
BYPASS_TOOL_CONSENTBypass consent for tool invocation, set to "true" to enablefalseAll tools that require consent (e.g. shell, file_write, python_repl)
STRANDS_TOOL_CONSOLE_MODEEnable rich UI for tools, set to "enabled" to enabledisabledAll tools that have optional rich UI
AWS_REGIONDefault AWS region for AWS operationsus-west-2use_aws, retrieve, generate_image, memory, nova_reels
AWS_PROFILEAWS profile name to use from ~/.aws/credentialsdefaultuse_aws, retrieve
LOG_LEVELLogging level (DEBUG, INFO, WARNING, ERROR)INFOAll tools

Tool-Specific Environment Variables

Calculator Tool

Environment VariableDescriptionDefault
CALCULATOR_MODEDefault calculation modeevaluate
CALCULATOR_PRECISIONNumber of decimal places for results10
CALCULATOR_SCIENTIFICWhether to use scientific notation for numbersFalse
CALCULATOR_FORCE_NUMERICForce numeric evaluation of symbolic expressionsFalse
CALCULATOR_FORCE_SCIENTIFIC_THRESHOLDThreshold for automatic scientific notation1e21
CALCULATOR_DERIVE_ORDERDefault order for derivatives1
CALCULATOR_SERIES_POINTDefault point for series expansion0
CALCULATOR_SERIES_ORDERDefault order for series expansion5

Current Time Tool

Environment VariableDescriptionDefault
DEFAULT_TIMEZONEDefault timezone for current_time toolUTC

Sleep Tool

Environment VariableDescriptionDefault
MAX_SLEEP_SECONDSMaximum allowed sleep duration in seconds300

Mem0 Memory Tool

The Mem0 Memory Tool supports three different backend configurations:

  1. Mem0 Platform:

    • Uses the Mem0 Platform API for memory management
    • Requires a Mem0 API key
  2. OpenSearch (Recommended for AWS environments):

    • Uses OpenSearch as the vector store backend
    • Requires AWS credentials and OpenSearch configuration
  3. FAISS (Default for local development):

    • Uses FAISS as the local vector store backend
    • Requires faiss-cpu package for local vector storage
Environment VariableDescriptionDefaultRequired For
MEM0_API_KEYMem0 Platform API keyNoneMem0 Platform
OPENSEARCH_HOSTOpenSearch Host URLNoneOpenSearch
AWS_REGIONAWS Region for OpenSearchus-west-2OpenSearch
DEVEnable development mode (bypasses confirmations)falseAll modes

Note:

  • If MEM0_API_KEY is set, the tool will use the Mem0 Platform
  • If OPENSEARCH_HOST is set, the tool will use OpenSearch
  • If neither is set, the tool will default to FAISS (requires faiss-cpu package)

Memory Tool

Environment VariableDescriptionDefault
MEMORY_DEFAULT_MAX_RESULTSDefault maximum results for list operations50
MEMORY_DEFAULT_MIN_SCOREDefault minimum relevance score for filtering results0.4

Nova Reels Tool

Environment VariableDescriptionDefault
NOVA_REEL_DEFAULT_SEEDDefault seed for video generation0
NOVA_REEL_DEFAULT_FPSDefault frames per second for generated videos24
NOVA_REEL_DEFAULT_DIMENSIONDefault video resolution in WIDTHxHEIGHT format1280x720
NOVA_REEL_DEFAULT_MAX_RESULTSDefault maximum number of jobs to return for list action10

Python REPL Tool

Environment VariableDescriptionDefault
PYTHON_REPL_BINARY_MAX_LENMaximum length for binary content before truncation100

Shell Tool

Environment VariableDescriptionDefault
SHELL_DEFAULT_TIMEOUTDefault timeout in seconds for shell commands900

Slack Tool

Environment VariableDescriptionDefault
SLACK_DEFAULT_EVENT_COUNTDefault number of events to retrieve42
STRANDS_SLACK_AUTO_REPLYEnable automatic replies to messagesfalse
STRANDS_SLACK_LISTEN_ONLY_TAGOnly process messages containing this tagNone

Speak Tool

Environment VariableDescriptionDefault
SPEAK_DEFAULT_STYLEDefault style for status messagesgreen
SPEAK_DEFAULT_MODEDefault speech mode (fast/polly)fast
SPEAK_DEFAULT_VOICE_IDDefault Polly voice IDJoanna
SPEAK_DEFAULT_OUTPUT_PATHDefault audio output pathspeech_output.mp3
SPEAK_DEFAULT_PLAY_AUDIOWhether to play audio by defaultTrue

Editor Tool

Environment VariableDescriptionDefault
EDITOR_DIR_TREE_MAX_DEPTHMaximum depth for directory tree visualization2
EDITOR_DEFAULT_STYLEDefault style for output panelsdefault
EDITOR_DEFAULT_LANGUAGEDefault language for syntax highlightingpython

Environment Tool

Environment VariableDescriptionDefault
ENV_VARS_MASKED_DEFAULTDefault setting for masking sensitive valuestrue

File Read Tool

Environment VariableDescriptionDefault
FILE_READ_RECURSIVE_DEFAULTDefault setting for recursive file searchingtrue
FILE_READ_CONTEXT_LINES_DEFAULTDefault number of context lines around search matches2
FILE_READ_START_LINE_DEFAULTDefault starting line number for lines mode0
FILE_READ_CHUNK_OFFSET_DEFAULTDefault byte offset for chunk mode0
FILE_READ_DIFF_TYPE_DEFAULTDefault diff type for file comparisonsunified
FILE_READ_USE_GIT_DEFAULTDefault setting for using git in time machine modetrue
FILE_READ_NUM_REVISIONS_DEFAULTDefault number of revisions to show in time machine mode5

Use Browser Tool

Environment VariableDescriptionDefault
STRANDS_DEFAULT_WAIT_TIMEDefault setting for wait time with actions1
STRANDS_BROWSER_MAX_RETRIESDefault number of retries to perform when an action fails3
STRANDS_BROWSER_RETRY_DELAYDefault retry delay time for retry mechanisms1
STRANDS_BROWSER_SCREENSHOTS_DIRDefault directory where screenshots will be savedscreenshots
STRANDS_BROWSER_USER_DATA_DIRDefault directory where data for reloading a browser instance is stored~/.browser_automation
STRANDS_BROWSER_HEADLESSDefault headless setting for launching browsersfalse
STRANDS_BROWSER_WIDTHDefault width of the browser1280
STRANDS_BROWSER_HEIGHTDefault height of the browser800

Contributing ❤️

This is a community-driven project, powered by passionate developers like you. We enthusiastically welcome contributions from everyone, regardless of experience level—your unique perspective is valuable to us!

How to Get Started?

  1. Find your first opportunity: If you're new to the project, explore our labeled "good first issues" for beginner-friendly tasks.
  2. Understand our workflow: Review our Contributing Guide to learn about our development setup, coding standards, and pull request process.
  3. Make your impact: Contributions come in many forms—fixing bugs, enhancing documentation, improving performance, adding features, writing tests, or refining the user experience.
  4. Submit your work: When you're ready, submit a well-documented pull request, and our maintainers will provide feedback to help get your changes merged.

Your questions, insights, and ideas are always welcome!

Together, we're building something meaningful that impacts real users. We look forward to collaborating with you!

License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

Security

See CONTRIBUTING for more information.

About

A set of tools that gives agents powerful capabilities.

Resources

Code of conduct

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Repository files navigation

Strands Agents

Strands Agents Tools

A model-driven approach to building AI agents in just a few lines of code.

GitHub commit activityGitHub open issuesGitHub open pull requestsLicensePyPI versionPython versions

DocumentationSamplesPython SDKToolsAgent BuilderMCP Server

Strands Agents Tools provides a powerful set of tools for your agents to use. It bridges the gap between large language models and practical applications by offering ready-to-use tools for file operations, system execution, API interactions, mathematical operations, and more.

✨ Features

  • 📁 File Operations - Read, write, and edit files with syntax highlighting and intelligent modifications
  • 🖥️ Shell Integration - Execute and interact with shell commands securely
  • 🧠 Memory - Store user and agent memories across agent runs to provide personalized experiences with both Mem0 and Amazon Bedrock Knowledge Bases
  • 🌐 HTTP Client - Make API requests with comprehensive authentication support
  • 💬 Slack Client - Real-time Slack events, message processing, and Slack API access
  • 🐍 Python Execution - Run Python code snippets with state persistence, user confirmation for code execution, and safety features
  • 🧮 Mathematical Tools - Perform advanced calculations with symbolic math capabilities
  • ☁️ AWS Integration - Seamless access to AWS services
  • 🖼️ Image Processing - Generate and process images for AI applications
  • 🎥 Video Processing - Use models and agents to generate dynamic videos
  • 🎙️ Audio Output - Enable models to generate audio and speak
  • 🔄 Environment Management - Handle environment variables safely
  • 📝 Journaling - Create and manage structured logs and journals
  • ⏱️ Task Scheduling - Schedule and manage cron jobs
  • 🧠 Advanced Reasoning - Tools for complex thinking and reasoning capabilities
  • 🐝 Swarm Intelligence - Coordinate multiple AI agents for parallel problem solving with shared memory
  • 🔄 Multiple tools in Parallel - Call multiple other tools at the same time in parallel with Batch Tool
  • 🔍 Browser Tool - Tool giving an agent access to perform automated actions on a browser (chromium)

📦 Installation

Quick Install

pip install strands-agents-tools

To install the dependencies for optional tools:

pip install strands-agents-tools[mem0_memory, use_browser]

Development Install

# Clone the repository
git clone https://github.com/strands-agents/tools.git
cd tools
# Create and activate virtual environment
python3 -m venv .venv
source .venv/bin/activate # On Windows: venv\Scripts\activate# Install in development mode
pip install -e ".[dev]"# Install pre-commit hooks
pre-commit install

Tools Overview

Below is a comprehensive table of all available tools, how to use them with an agent, and typical use cases:

ToolAgent UsageUse Case
a2a_clientprovider = A2AClientToolProvider(known_agent_urls=["http://localhost:9000"]); agent = Agent(tools=provider.tools)Discover and communicate with A2A-compliant agents, send messages between agents
file_readagent.tool.file_read(path="path/to/file.txt")Reading configuration files, parsing code files, loading datasets
file_writeagent.tool.file_write(path="path/to/file.txt", content="file content")Writing results to files, creating new files, saving output data
editoragent.tool.editor(command="view", path="path/to/file.py")Advanced file operations like syntax highlighting, pattern replacement, and multi-file edits
shell*agent.tool.shell(command="ls -la")Executing shell commands, interacting with the operating system, running scripts
http_requestagent.tool.http_request(method="GET", url="https://api.example.com/data")Making API calls, fetching web data, sending data to external services
python_repl*agent.tool.python_repl(code="import pandas as pd\ndf = pd.read_csv('data.csv')\nprint(df.head())")Running Python code snippets, data analysis, executing complex logic with user confirmation for security
calculatoragent.tool.calculator(expression="2 * sin(pi/4) + log(e**2)")Performing mathematical operations, symbolic math, equation solving
use_awsagent.tool.use_aws(service_name="s3", operation_name="list_buckets", parameters={}, region="us-west-2")Interacting with AWS services, cloud resource management
retrieveagent.tool.retrieve(text="What is STRANDS?")Retrieving information from Amazon Bedrock Knowledge Bases
nova_reelsagent.tool.nova_reels(action="create", text="A cinematic shot of mountains", s3_bucket="my-bucket")Create high-quality videos using Amazon Bedrock Nova Reel with configurable parameters via environment variables
mem0_memoryagent.tool.mem0_memory(action="store", content="Remember I like to play tennis", user_id="alex")Store user and agent memories across agent runs to provide personalized experience
memoryagent.tool.memory(action="retrieve", query="product features")Store, retrieve, list, and manage documents in Amazon Bedrock Knowledge Bases with configurable parameters via environment variables
environmentagent.tool.environment(action="list", prefix="AWS_")Managing environment variables, configuration management
generate_image_stabilityagent.tool.generate_image_stability(prompt="A tranquil pool")Creating images using Stability AI models
generate_imageagent.tool.generate_image(prompt="A sunset over mountains")Creating AI-generated images for various applications
image_readeragent.tool.image_reader(image_path="path/to/image.jpg")Processing and reading image files for AI analysis
journalagent.tool.journal(action="write", content="Today's progress notes")Creating structured logs, maintaining documentation
thinkagent.tool.think(thought="Complex problem to analyze", cycle_count=3)Advanced reasoning, multi-step thinking processes
load_toolagent.tool.load_tool(path="path/to/custom_tool.py", name="custom_tool")Dynamically loading custom tools and extensions
swarmagent.tool.swarm(task="Analyze this problem", swarm_size=3, coordination_pattern="collaborative")Coordinating multiple AI agents to solve complex problems through collective intelligence
current_timeagent.tool.current_time(timezone="US/Pacific")Get the current time in ISO 8601 format for a specified timezone
sleepagent.tool.sleep(seconds=5)Pause execution for the specified number of seconds, interruptible with SIGINT (Ctrl+C)
agent_graphagent.tool.agent_graph(agents=["agent1", "agent2"], connections=[{"from": "agent1", "to": "agent2"}])Create and visualize agent relationship graphs for complex multi-agent systems
cron*agent.tool.cron(action="schedule", name="task", schedule="0 * * * *", command="backup.sh")Schedule and manage recurring tasks with cron job syntax
**Does not work on Windows
slackagent.tool.slack(action="post_message", channel="general", text="Hello team!")Interact with Slack workspace for messaging and monitoring
speakagent.tool.speak(text="Operation completed successfully", style="green", mode="polly")Output status messages with rich formatting and optional text-to-speech
stopagent.tool.stop(message="Process terminated by user request")Gracefully terminate agent execution with custom message
handoff_to_useragent.tool.handoff_to_user(message="Please confirm action", breakout_of_loop=False)Hand off control to user for confirmation, input, or complete task handoff
use_llmagent.tool.use_llm(prompt="Analyze this data", system_prompt="You are a data analyst")Create nested AI loops with customized system prompts for specialized tasks
workflowagent.tool.workflow(action="create", name="data_pipeline", steps=[{"tool": "file_read"}, {"tool": "python_repl"}])Define, execute, and manage multi-step automated workflows
batchagent.tool.batch(invocations=[{"name": "current_time", "arguments": {"timezone": "Europe/London"}}, {"name": "stop", "arguments": {}}])Call multiple other tools in parallel.
use_browseragent.tool.use_browser(action="navigate", url="https://www.example.com") Web scraping, automated testing, form filling, web automation tasks

* These tools do not work on windows

💻 Usage Examples

File Operations

fromstrandsimportAgentfromstrands_toolsimportfile_read, file_write, editoragent=Agent(tools=[file_read, file_write, editor])
agent.tool.file_read(path="config.json")
agent.tool.file_write(path="output.txt", content="Hello, world!")
agent.tool.editor(command="view", path="script.py")

Shell Commands

Note: shell does not work on Windows.

fromstrandsimportAgentfromstrands_toolsimportshellagent=Agent(tools=[shell])
# Execute a single commandresult=agent.tool.shell(command="ls -la")
# Execute a sequence of commandsresults=agent.tool.shell(command=["mkdir -p test_dir", "cd test_dir", "touch test.txt"])
# Execute commands with error handlingagent.tool.shell(command="risky-command", ignore_errors=True)

HTTP Requests

fromstrandsimportAgentfromstrands_toolsimporthttp_requestagent=Agent(tools=[http_request])
# Make a simple GET requestresponse=agent.tool.http_request(
method="GET",
url="https://api.example.com/data"
)
# POST request with authenticationresponse=agent.tool.http_request(
method="POST",
url="https://api.example.com/resource",
headers={"Content-Type": "application/json"},
body=json.dumps({"key": "value"}),
auth_type="Bearer",
auth_token="your_token_here"
)
# Convert HTML webpages to markdown for better readabilityresponse=agent.tool.http_request(
method="GET",
url="https://example.com/article",
convert_to_markdown=True
)

Python Code Execution

Note: python_repl does not work on Windows.

fromstrandsimportAgentfromstrands_toolsimportpython_replagent=Agent(tools=[python_repl])
# Execute Python code with state persistenceresult=agent.tool.python_repl(code="""import pandas as pd# Load and process datadata = pd.read_csv('data.csv')processed = data.groupby('category').mean()processed.head()""")

Swarm Intelligence

fromstrandsimportAgentfromstrands_toolsimportswarmagent=Agent(tools=[swarm])
# Create a collaborative swarm of agents to tackle a complex problemresult=agent.tool.swarm(
task="Generate creative solutions for reducing plastic waste in urban areas",
swarm_size=5,
coordination_pattern="collaborative"
)
# Create a competitive swarm for diverse solution generationresult=agent.tool.swarm(
task="Design an innovative product for smart home automation",
swarm_size=3,
coordination_pattern="competitive"
)
# Hybrid approach combining collaboration and competitionresult=agent.tool.swarm(
task="Develop marketing strategies for a new sustainable fashion brand",
swarm_size=4,
coordination_pattern="hybrid"
)

Use AWS

fromstrandsimportAgentfromstrands_toolsimportuse_awsagent=Agent(tools=[use_aws])
# List S3 bucketsresult=agent.tool.use_aws(
service_name="s3",
operation_name="list_buckets",
parameters={},
region="us-east-1",
label="List all S3 buckets"
)
# Get the contents of a specific S3 bucketresult=agent.tool.use_aws(
service_name="s3",
operation_name="list_objects_v2",
parameters={"Bucket": "example-bucket"}, # Replace with your actual bucket nameregion="us-east-1",
label="List objects in a specific S3 bucket"
)
# Get the list of EC2 subnetsresult=agent.tool.use_aws(
service_name="ec2",
operation_name="describe_subnets",
parameters={},
region="us-east-1",
label="List all subnets"
)

Batch Tool

importosimportsysfromstrandsimportAgentfromstrands_toolsimportbatch, http_request, use_aws# Example usage of the batch with http_request and use_aws toolsagent=Agent(tools=[batch, http_request, use_aws])
result=agent.tool.batch(
invocations=[
{"name": "http_request", "arguments": {"method": "GET", "url": "https://api.ipify.org?format=json"}},
{
"name": "use_aws",
"arguments": {
"service_name": "s3",
"operation_name": "list_buckets",
"parameters": {},
"region": "us-east-1",
"label": "List S3 Buckets"
}
},
]
)

Use Browser

fromstrandsimportAgentfromstrands_toolsimportuse_browseragent=Agent(tools=[use_browser])
# Simple navigationresult=agent.tool.use_browser(action="navigate", url="https://example.com")
# Sequential actions for form fillingresult=agent.tool.use_browser(actions=[
{"action": "navigate", "args": {"url": "https://example.com/login"}},
{"action": "type", "args": {"selector": "#username", "text": "user@example.com"}},
{"action": "click", "args": {"selector": "#submit"}}
])
# Web scraping with content extractionresult=agent.tool.use_browser(actions=[
{"action": "navigate", "args": {"url": "https://example.com/data"}},
{"action": "get_text", "args": {"selector": ".content"}},
{"action": "click", "args": {"selector": ".next-page"}},
{"action": "get_html", "args": {"selector": "main"}}
])

Handoff to User

fromstrandsimportAgentfromstrands_toolsimporthandoff_to_useragent=Agent(tools=[handoff_to_user])
# Request user confirmation and continueresponse=agent.tool.handoff_to_user(
message="I need your approval to proceed with deleting these files. 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 and take any necessary follow-up actions.",
breakout_of_loop=True
)

A2A Client

fromstrandsimportAgentfromstrands_tools.a2a_clientimportA2AClientToolProvider# Initialize the A2A client provider with known agent URLsprovider=A2AClientToolProvider(known_agent_urls=["http://localhost:9000"])
agent=Agent(tools=provider.tools)
# Use natural language to interact with A2A agentsresponse=agent("discover available agents and send a greeting message")
# The agent will automatically use the available tools:# - discover_agent(url) to find agents# - list_discovered_agents() to see all discovered agents# - send_message(message_text, target_agent_url) to communicate

🌍 Environment Variables Configuration

Agents Tools provides extensive customization through environment variables. This allows you to configure tool behavior without modifying code, making it ideal for different environments (development, testing, production).

Global Environment Variables

These variables affect multiple tools:

Environment VariableDescriptionDefaultAffected Tools
BYPASS_TOOL_CONSENTBypass consent for tool invocation, set to "true" to enablefalseAll tools that require consent (e.g. shell, file_write, python_repl)
STRANDS_TOOL_CONSOLE_MODEEnable rich UI for tools, set to "enabled" to enabledisabledAll tools that have optional rich UI
AWS_REGIONDefault AWS region for AWS operationsus-west-2use_aws, retrieve, generate_image, memory, nova_reels
AWS_PROFILEAWS profile name to use from ~/.aws/credentialsdefaultuse_aws, retrieve
LOG_LEVELLogging level (DEBUG, INFO, WARNING, ERROR)INFOAll tools

Tool-Specific Environment Variables

Calculator Tool

Environment VariableDescriptionDefault
CALCULATOR_MODEDefault calculation modeevaluate
CALCULATOR_PRECISIONNumber of decimal places for results10
CALCULATOR_SCIENTIFICWhether to use scientific notation for numbersFalse
CALCULATOR_FORCE_NUMERICForce numeric evaluation of symbolic expressionsFalse
CALCULATOR_FORCE_SCIENTIFIC_THRESHOLDThreshold for automatic scientific notation1e21
CALCULATOR_DERIVE_ORDERDefault order for derivatives1
CALCULATOR_SERIES_POINTDefault point for series expansion0
CALCULATOR_SERIES_ORDERDefault order for series expansion5

Current Time Tool

Environment VariableDescriptionDefault
DEFAULT_TIMEZONEDefault timezone for current_time toolUTC

Sleep Tool

Environment VariableDescriptionDefault
MAX_SLEEP_SECONDSMaximum allowed sleep duration in seconds300

Mem0 Memory Tool

The Mem0 Memory Tool supports three different backend configurations:

  1. Mem0 Platform:

    • Uses the Mem0 Platform API for memory management
    • Requires a Mem0 API key
  2. OpenSearch (Recommended for AWS environments):

    • Uses OpenSearch as the vector store backend
    • Requires AWS credentials and OpenSearch configuration
  3. FAISS (Default for local development):

    • Uses FAISS as the local vector store backend
    • Requires faiss-cpu package for local vector storage
Environment VariableDescriptionDefaultRequired For
MEM0_API_KEYMem0 Platform API keyNoneMem0 Platform
OPENSEARCH_HOSTOpenSearch Host URLNoneOpenSearch
AWS_REGIONAWS Region for OpenSearchus-west-2OpenSearch
DEVEnable development mode (bypasses confirmations)falseAll modes

Note:

  • If MEM0_API_KEY is set, the tool will use the Mem0 Platform
  • If OPENSEARCH_HOST is set, the tool will use OpenSearch
  • If neither is set, the tool will default to FAISS (requires faiss-cpu package)

Memory Tool

Environment VariableDescriptionDefault
MEMORY_DEFAULT_MAX_RESULTSDefault maximum results for list operations50
MEMORY_DEFAULT_MIN_SCOREDefault minimum relevance score for filtering results0.4

Nova Reels Tool

Environment VariableDescriptionDefault
NOVA_REEL_DEFAULT_SEEDDefault seed for video generation0
NOVA_REEL_DEFAULT_FPSDefault frames per second for generated videos24
NOVA_REEL_DEFAULT_DIMENSIONDefault video resolution in WIDTHxHEIGHT format1280x720
NOVA_REEL_DEFAULT_MAX_RESULTSDefault maximum number of jobs to return for list action10

Python REPL Tool

Environment VariableDescriptionDefault
PYTHON_REPL_BINARY_MAX_LENMaximum length for binary content before truncation100

Shell Tool

Environment VariableDescriptionDefault
SHELL_DEFAULT_TIMEOUTDefault timeout in seconds for shell commands900

Slack Tool

Environment VariableDescriptionDefault
SLACK_DEFAULT_EVENT_COUNTDefault number of events to retrieve42
STRANDS_SLACK_AUTO_REPLYEnable automatic replies to messagesfalse
STRANDS_SLACK_LISTEN_ONLY_TAGOnly process messages containing this tagNone

Speak Tool

Environment VariableDescriptionDefault
SPEAK_DEFAULT_STYLEDefault style for status messagesgreen
SPEAK_DEFAULT_MODEDefault speech mode (fast/polly)fast
SPEAK_DEFAULT_VOICE_IDDefault Polly voice IDJoanna
SPEAK_DEFAULT_OUTPUT_PATHDefault audio output pathspeech_output.mp3
SPEAK_DEFAULT_PLAY_AUDIOWhether to play audio by defaultTrue

Editor Tool

Environment VariableDescriptionDefault
EDITOR_DIR_TREE_MAX_DEPTHMaximum depth for directory tree visualization2
EDITOR_DEFAULT_STYLEDefault style for output panelsdefault
EDITOR_DEFAULT_LANGUAGEDefault language for syntax highlightingpython

Environment Tool

Environment VariableDescriptionDefault
ENV_VARS_MASKED_DEFAULTDefault setting for masking sensitive valuestrue

File Read Tool

Environment VariableDescriptionDefault
FILE_READ_RECURSIVE_DEFAULTDefault setting for recursive file searchingtrue
FILE_READ_CONTEXT_LINES_DEFAULTDefault number of context lines around search matches2
FILE_READ_START_LINE_DEFAULTDefault starting line number for lines mode0
FILE_READ_CHUNK_OFFSET_DEFAULTDefault byte offset for chunk mode0
FILE_READ_DIFF_TYPE_DEFAULTDefault diff type for file comparisonsunified
FILE_READ_USE_GIT_DEFAULTDefault setting for using git in time machine modetrue
FILE_READ_NUM_REVISIONS_DEFAULTDefault number of revisions to show in time machine mode5

Use Browser Tool

Environment VariableDescriptionDefault
STRANDS_DEFAULT_WAIT_TIMEDefault setting for wait time with actions1
STRANDS_BROWSER_MAX_RETRIESDefault number of retries to perform when an action fails3
STRANDS_BROWSER_RETRY_DELAYDefault retry delay time for retry mechanisms1
STRANDS_BROWSER_SCREENSHOTS_DIRDefault directory where screenshots will be savedscreenshots
STRANDS_BROWSER_USER_DATA_DIRDefault directory where data for reloading a browser instance is stored~/.browser_automation
STRANDS_BROWSER_HEADLESSDefault headless setting for launching browsersfalse
STRANDS_BROWSER_WIDTHDefault width of the browser1280
STRANDS_BROWSER_HEIGHTDefault height of the browser800

Contributing ❤️

This is a community-driven project, powered by passionate developers like you. We enthusiastically welcome contributions from everyone, regardless of experience level—your unique perspective is valuable to us!

How to Get Started?

  1. Find your first opportunity: If you're new to the project, explore our labeled "good first issues" for beginner-friendly tasks.
  2. Understand our workflow: Review our Contributing Guide to learn about our development setup, coding standards, and pull request process.
  3. Make your impact: Contributions come in many forms—fixing bugs, enhancing documentation, improving performance, adding features, writing tests, or refining the user experience.
  4. Submit your work: When you're ready, submit a well-documented pull request, and our maintainers will provide feedback to help get your changes merged.

Your questions, insights, and ideas are always welcome!

Together, we're building something meaningful that impacts real users. We look forward to collaborating with you!

License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

Security

See CONTRIBUTING for more information.

About

A set of tools that gives agents powerful capabilities.

Resources

Code of conduct

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content

Repository files navigation

Strands Agents

Strands Agents Tools

A model-driven approach to building AI agents in just a few lines of code.

GitHub commit activityGitHub open issuesGitHub open pull requestsLicensePyPI versionPython versions

DocumentationSamplesPython SDKToolsAgent BuilderMCP Server

Strands Agents Tools provides a powerful set of tools for your agents to use. It bridges the gap between large language models and practical applications by offering ready-to-use tools for file operations, system execution, API interactions, mathematical operations, and more.

✨ Features

  • 📁 File Operations - Read, write, and edit files with syntax highlighting and intelligent modifications
  • 🖥️ Shell Integration - Execute and interact with shell commands securely
  • 🧠 Memory - Store user and agent memories across agent runs to provide personalized experiences with both Mem0 and Amazon Bedrock Knowledge Bases
  • 🌐 HTTP Client - Make API requests with comprehensive authentication support
  • 💬 Slack Client - Real-time Slack events, message processing, and Slack API access
  • 🐍 Python Execution - Run Python code snippets with state persistence, user confirmation for code execution, and safety features
  • 🧮 Mathematical Tools - Perform advanced calculations with symbolic math capabilities
  • ☁️ AWS Integration - Seamless access to AWS services
  • 🖼️ Image Processing - Generate and process images for AI applications
  • 🎥 Video Processing - Use models and agents to generate dynamic videos
  • 🎙️ Audio Output - Enable models to generate audio and speak
  • 🔄 Environment Management - Handle environment variables safely
  • 📝 Journaling - Create and manage structured logs and journals
  • ⏱️ Task Scheduling - Schedule and manage cron jobs
  • 🧠 Advanced Reasoning - Tools for complex thinking and reasoning capabilities
  • 🐝 Swarm Intelligence - Coordinate multiple AI agents for parallel problem solving with shared memory
  • 🔄 Multiple tools in Parallel - Call multiple other tools at the same time in parallel with Batch Tool
  • 🔍 Browser Tool - Tool giving an agent access to perform automated actions on a browser (chromium)

📦 Installation

Quick Install

pip install strands-agents-tools

To install the dependencies for optional tools:

pip install strands-agents-tools[mem0_memory, use_browser]

Development Install

# Clone the repository
git clone https://github.com/strands-agents/tools.git
cd tools
# Create and activate virtual environment
python3 -m venv .venv
source .venv/bin/activate # On Windows: venv\Scripts\activate# Install in development mode
pip install -e ".[dev]"# Install pre-commit hooks
pre-commit install

Tools Overview

Below is a comprehensive table of all available tools, how to use them with an agent, and typical use cases:

ToolAgent UsageUse Case
a2a_clientprovider = A2AClientToolProvider(known_agent_urls=["http://localhost:9000"]); agent = Agent(tools=provider.tools)Discover and communicate with A2A-compliant agents, send messages between agents
file_readagent.tool.file_read(path="path/to/file.txt")Reading configuration files, parsing code files, loading datasets
file_writeagent.tool.file_write(path="path/to/file.txt", content="file content")Writing results to files, creating new files, saving output data
editoragent.tool.editor(command="view", path="path/to/file.py")Advanced file operations like syntax highlighting, pattern replacement, and multi-file edits
shell*agent.tool.shell(command="ls -la")Executing shell commands, interacting with the operating system, running scripts
http_requestagent.tool.http_request(method="GET", url="https://api.example.com/data")Making API calls, fetching web data, sending data to external services
python_repl*agent.tool.python_repl(code="import pandas as pd\ndf = pd.read_csv('data.csv')\nprint(df.head())")Running Python code snippets, data analysis, executing complex logic with user confirmation for security
calculatoragent.tool.calculator(expression="2 * sin(pi/4) + log(e**2)")Performing mathematical operations, symbolic math, equation solving
use_awsagent.tool.use_aws(service_name="s3", operation_name="list_buckets", parameters={}, region="us-west-2")Interacting with AWS services, cloud resource management
retrieveagent.tool.retrieve(text="What is STRANDS?")Retrieving information from Amazon Bedrock Knowledge Bases
nova_reelsagent.tool.nova_reels(action="create", text="A cinematic shot of mountains", s3_bucket="my-bucket")Create high-quality videos using Amazon Bedrock Nova Reel with configurable parameters via environment variables
mem0_memoryagent.tool.mem0_memory(action="store", content="Remember I like to play tennis", user_id="alex")Store user and agent memories across agent runs to provide personalized experience
memoryagent.tool.memory(action="retrieve", query="product features")Store, retrieve, list, and manage documents in Amazon Bedrock Knowledge Bases with configurable parameters via environment variables
environmentagent.tool.environment(action="list", prefix="AWS_")Managing environment variables, configuration management
generate_image_stabilityagent.tool.generate_image_stability(prompt="A tranquil pool")Creating images using Stability AI models
generate_imageagent.tool.generate_image(prompt="A sunset over mountains")Creating AI-generated images for various applications
image_readeragent.tool.image_reader(image_path="path/to/image.jpg")Processing and reading image files for AI analysis
journalagent.tool.journal(action="write", content="Today's progress notes")Creating structured logs, maintaining documentation
thinkagent.tool.think(thought="Complex problem to analyze", cycle_count=3)Advanced reasoning, multi-step thinking processes
load_toolagent.tool.load_tool(path="path/to/custom_tool.py", name="custom_tool")Dynamically loading custom tools and extensions
swarmagent.tool.swarm(task="Analyze this problem", swarm_size=3, coordination_pattern="collaborative")Coordinating multiple AI agents to solve complex problems through collective intelligence
current_timeagent.tool.current_time(timezone="US/Pacific")Get the current time in ISO 8601 format for a specified timezone
sleepagent.tool.sleep(seconds=5)Pause execution for the specified number of seconds, interruptible with SIGINT (Ctrl+C)
agent_graphagent.tool.agent_graph(agents=["agent1", "agent2"], connections=[{"from": "agent1", "to": "agent2"}])Create and visualize agent relationship graphs for complex multi-agent systems
cron*agent.tool.cron(action="schedule", name="task", schedule="0 * * * *", command="backup.sh")Schedule and manage recurring tasks with cron job syntax
**Does not work on Windows
slackagent.tool.slack(action="post_message", channel="general", text="Hello team!")Interact with Slack workspace for messaging and monitoring
speakagent.tool.speak(text="Operation completed successfully", style="green", mode="polly")Output status messages with rich formatting and optional text-to-speech
stopagent.tool.stop(message="Process terminated by user request")Gracefully terminate agent execution with custom message
handoff_to_useragent.tool.handoff_to_user(message="Please confirm action", breakout_of_loop=False)Hand off control to user for confirmation, input, or complete task handoff
use_llmagent.tool.use_llm(prompt="Analyze this data", system_prompt="You are a data analyst")Create nested AI loops with customized system prompts for specialized tasks
workflowagent.tool.workflow(action="create", name="data_pipeline", steps=[{"tool": "file_read"}, {"tool": "python_repl"}])Define, execute, and manage multi-step automated workflows
batchagent.tool.batch(invocations=[{"name": "current_time", "arguments": {"timezone": "Europe/London"}}, {"name": "stop", "arguments": {}}])Call multiple other tools in parallel.
use_browseragent.tool.use_browser(action="navigate", url="https://www.example.com") Web scraping, automated testing, form filling, web automation tasks

* These tools do not work on windows

💻 Usage Examples

File Operations

fromstrandsimportAgentfromstrands_toolsimportfile_read, file_write, editoragent=Agent(tools=[file_read, file_write, editor])
agent.tool.file_read(path="config.json")
agent.tool.file_write(path="output.txt", content="Hello, world!")
agent.tool.editor(command="view", path="script.py")

Shell Commands

Note: shell does not work on Windows.

fromstrandsimportAgentfromstrands_toolsimportshellagent=Agent(tools=[shell])
# Execute a single commandresult=agent.tool.shell(command="ls -la")
# Execute a sequence of commandsresults=agent.tool.shell(command=["mkdir -p test_dir", "cd test_dir", "touch test.txt"])
# Execute commands with error handlingagent.tool.shell(command="risky-command", ignore_errors=True)

HTTP Requests

fromstrandsimportAgentfromstrands_toolsimporthttp_requestagent=Agent(tools=[http_request])
# Make a simple GET requestresponse=agent.tool.http_request(
method="GET",
url="https://api.example.com/data"
)
# POST request with authenticationresponse=agent.tool.http_request(
method="POST",
url="https://api.example.com/resource",
headers={"Content-Type": "application/json"},
body=json.dumps({"key": "value"}),
auth_type="Bearer",
auth_token="your_token_here"
)
# Convert HTML webpages to markdown for better readabilityresponse=agent.tool.http_request(
method="GET",
url="https://example.com/article",
convert_to_markdown=True
)

Python Code Execution

Note: python_repl does not work on Windows.

fromstrandsimportAgentfromstrands_toolsimportpython_replagent=Agent(tools=[python_repl])
# Execute Python code with state persistenceresult=agent.tool.python_repl(code="""import pandas as pd# Load and process datadata = pd.read_csv('data.csv')processed = data.groupby('category').mean()processed.head()""")

Swarm Intelligence

fromstrandsimportAgentfromstrands_toolsimportswarmagent=Agent(tools=[swarm])
# Create a collaborative swarm of agents to tackle a complex problemresult=agent.tool.swarm(
task="Generate creative solutions for reducing plastic waste in urban areas",
swarm_size=5,
coordination_pattern="collaborative"
)
# Create a competitive swarm for diverse solution generationresult=agent.tool.swarm(
task="Design an innovative product for smart home automation",
swarm_size=3,
coordination_pattern="competitive"
)
# Hybrid approach combining collaboration and competitionresult=agent.tool.swarm(
task="Develop marketing strategies for a new sustainable fashion brand",
swarm_size=4,
coordination_pattern="hybrid"
)

Use AWS

fromstrandsimportAgentfromstrands_toolsimportuse_awsagent=Agent(tools=[use_aws])
# List S3 bucketsresult=agent.tool.use_aws(
service_name="s3",
operation_name="list_buckets",
parameters={},
region="us-east-1",
label="List all S3 buckets"
)
# Get the contents of a specific S3 bucketresult=agent.tool.use_aws(
service_name="s3",
operation_name="list_objects_v2",
parameters={"Bucket": "example-bucket"}, # Replace with your actual bucket nameregion="us-east-1",
label="List objects in a specific S3 bucket"
)
# Get the list of EC2 subnetsresult=agent.tool.use_aws(
service_name="ec2",
operation_name="describe_subnets",
parameters={},
region="us-east-1",
label="List all subnets"
)

Batch Tool

importosimportsysfromstrandsimportAgentfromstrands_toolsimportbatch, http_request, use_aws# Example usage of the batch with http_request and use_aws toolsagent=Agent(tools=[batch, http_request, use_aws])
result=agent.tool.batch(
invocations=[
{"name": "http_request", "arguments": {"method": "GET", "url": "https://api.ipify.org?format=json"}},
{
"name": "use_aws",
"arguments": {
"service_name": "s3",
"operation_name": "list_buckets",
"parameters": {},
"region": "us-east-1",
"label": "List S3 Buckets"
}
},
]
)

Use Browser

fromstrandsimportAgentfromstrands_toolsimportuse_browseragent=Agent(tools=[use_browser])
# Simple navigationresult=agent.tool.use_browser(action="navigate", url="https://example.com")
# Sequential actions for form fillingresult=agent.tool.use_browser(actions=[
{"action": "navigate", "args": {"url": "https://example.com/login"}},
{"action": "type", "args": {"selector": "#username", "text": "user@example.com"}},
{"action": "click", "args": {"selector": "#submit"}}
])
# Web scraping with content extractionresult=agent.tool.use_browser(actions=[
{"action": "navigate", "args": {"url": "https://example.com/data"}},
{"action": "get_text", "args": {"selector": ".content"}},
{"action": "click", "args": {"selector": ".next-page"}},
{"action": "get_html", "args": {"selector": "main"}}
])

Handoff to User

fromstrandsimportAgentfromstrands_toolsimporthandoff_to_useragent=Agent(tools=[handoff_to_user])
# Request user confirmation and continueresponse=agent.tool.handoff_to_user(
message="I need your approval to proceed with deleting these files. 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 and take any necessary follow-up actions.",
breakout_of_loop=True
)

A2A Client

fromstrandsimportAgentfromstrands_tools.a2a_clientimportA2AClientToolProvider# Initialize the A2A client provider with known agent URLsprovider=A2AClientToolProvider(known_agent_urls=["http://localhost:9000"])
agent=Agent(tools=provider.tools)
# Use natural language to interact with A2A agentsresponse=agent("discover available agents and send a greeting message")
# The agent will automatically use the available tools:# - discover_agent(url) to find agents# - list_discovered_agents() to see all discovered agents# - send_message(message_text, target_agent_url) to communicate

🌍 Environment Variables Configuration

Agents Tools provides extensive customization through environment variables. This allows you to configure tool behavior without modifying code, making it ideal for different environments (development, testing, production).

Global Environment Variables

These variables affect multiple tools:

Environment VariableDescriptionDefaultAffected Tools
BYPASS_TOOL_CONSENTBypass consent for tool invocation, set to "true" to enablefalseAll tools that require consent (e.g. shell, file_write, python_repl)
STRANDS_TOOL_CONSOLE_MODEEnable rich UI for tools, set to "enabled" to enabledisabledAll tools that have optional rich UI
AWS_REGIONDefault AWS region for AWS operationsus-west-2use_aws, retrieve, generate_image, memory, nova_reels
AWS_PROFILEAWS profile name to use from ~/.aws/credentialsdefaultuse_aws, retrieve
LOG_LEVELLogging level (DEBUG, INFO, WARNING, ERROR)INFOAll tools

Tool-Specific Environment Variables

Calculator Tool

Environment VariableDescriptionDefault
CALCULATOR_MODEDefault calculation modeevaluate
CALCULATOR_PRECISIONNumber of decimal places for results10
CALCULATOR_SCIENTIFICWhether to use scientific notation for numbersFalse
CALCULATOR_FORCE_NUMERICForce numeric evaluation of symbolic expressionsFalse
CALCULATOR_FORCE_SCIENTIFIC_THRESHOLDThreshold for automatic scientific notation1e21
CALCULATOR_DERIVE_ORDERDefault order for derivatives1
CALCULATOR_SERIES_POINTDefault point for series expansion0
CALCULATOR_SERIES_ORDERDefault order for series expansion5

Current Time Tool

Environment VariableDescriptionDefault
DEFAULT_TIMEZONEDefault timezone for current_time toolUTC

Sleep Tool

Environment VariableDescriptionDefault
MAX_SLEEP_SECONDSMaximum allowed sleep duration in seconds300

Mem0 Memory Tool

The Mem0 Memory Tool supports three different backend configurations:

  1. Mem0 Platform:

    • Uses the Mem0 Platform API for memory management
    • Requires a Mem0 API key
  2. OpenSearch (Recommended for AWS environments):

    • Uses OpenSearch as the vector store backend
    • Requires AWS credentials and OpenSearch configuration
  3. FAISS (Default for local development):

    • Uses FAISS as the local vector store backend
    • Requires faiss-cpu package for local vector storage
Environment VariableDescriptionDefaultRequired For
MEM0_API_KEYMem0 Platform API keyNoneMem0 Platform
OPENSEARCH_HOSTOpenSearch Host URLNoneOpenSearch
AWS_REGIONAWS Region for OpenSearchus-west-2OpenSearch
DEVEnable development mode (bypasses confirmations)falseAll modes

Note:

  • If MEM0_API_KEY is set, the tool will use the Mem0 Platform
  • If OPENSEARCH_HOST is set, the tool will use OpenSearch
  • If neither is set, the tool will default to FAISS (requires faiss-cpu package)

Memory Tool

Environment VariableDescriptionDefault
MEMORY_DEFAULT_MAX_RESULTSDefault maximum results for list operations50
MEMORY_DEFAULT_MIN_SCOREDefault minimum relevance score for filtering results0.4

Nova Reels Tool

Environment VariableDescriptionDefault
NOVA_REEL_DEFAULT_SEEDDefault seed for video generation0
NOVA_REEL_DEFAULT_FPSDefault frames per second for generated videos24
NOVA_REEL_DEFAULT_DIMENSIONDefault video resolution in WIDTHxHEIGHT format1280x720
NOVA_REEL_DEFAULT_MAX_RESULTSDefault maximum number of jobs to return for list action10

Python REPL Tool

Environment VariableDescriptionDefault
PYTHON_REPL_BINARY_MAX_LENMaximum length for binary content before truncation100

Shell Tool

Environment VariableDescriptionDefault
SHELL_DEFAULT_TIMEOUTDefault timeout in seconds for shell commands900

Slack Tool

Environment VariableDescriptionDefault
SLACK_DEFAULT_EVENT_COUNTDefault number of events to retrieve42
STRANDS_SLACK_AUTO_REPLYEnable automatic replies to messagesfalse
STRANDS_SLACK_LISTEN_ONLY_TAGOnly process messages containing this tagNone

Speak Tool

Environment VariableDescriptionDefault
SPEAK_DEFAULT_STYLEDefault style for status messagesgreen
SPEAK_DEFAULT_MODEDefault speech mode (fast/polly)fast
SPEAK_DEFAULT_VOICE_IDDefault Polly voice IDJoanna
SPEAK_DEFAULT_OUTPUT_PATHDefault audio output pathspeech_output.mp3
SPEAK_DEFAULT_PLAY_AUDIOWhether to play audio by defaultTrue

Editor Tool

Environment VariableDescriptionDefault
EDITOR_DIR_TREE_MAX_DEPTHMaximum depth for directory tree visualization2
EDITOR_DEFAULT_STYLEDefault style for output panelsdefault
EDITOR_DEFAULT_LANGUAGEDefault language for syntax highlightingpython

Environment Tool

Environment VariableDescriptionDefault
ENV_VARS_MASKED_DEFAULTDefault setting for masking sensitive valuestrue

File Read Tool

Environment VariableDescriptionDefault
FILE_READ_RECURSIVE_DEFAULTDefault setting for recursive file searchingtrue
FILE_READ_CONTEXT_LINES_DEFAULTDefault number of context lines around search matches2
FILE_READ_START_LINE_DEFAULTDefault starting line number for lines mode0
FILE_READ_CHUNK_OFFSET_DEFAULTDefault byte offset for chunk mode0
FILE_READ_DIFF_TYPE_DEFAULTDefault diff type for file comparisonsunified
FILE_READ_USE_GIT_DEFAULTDefault setting for using git in time machine modetrue
FILE_READ_NUM_REVISIONS_DEFAULTDefault number of revisions to show in time machine mode5

Use Browser Tool

Environment VariableDescriptionDefault
STRANDS_DEFAULT_WAIT_TIMEDefault setting for wait time with actions1
STRANDS_BROWSER_MAX_RETRIESDefault number of retries to perform when an action fails3
STRANDS_BROWSER_RETRY_DELAYDefault retry delay time for retry mechanisms1
STRANDS_BROWSER_SCREENSHOTS_DIRDefault directory where screenshots will be savedscreenshots
STRANDS_BROWSER_USER_DATA_DIRDefault directory where data for reloading a browser instance is stored~/.browser_automation
STRANDS_BROWSER_HEADLESSDefault headless setting for launching browsersfalse
STRANDS_BROWSER_WIDTHDefault width of the browser1280
STRANDS_BROWSER_HEIGHTDefault height of the browser800

Contributing ❤️

This is a community-driven project, powered by passionate developers like you. We enthusiastically welcome contributions from everyone, regardless of experience level—your unique perspective is valuable to us!

How to Get Started?

  1. Find your first opportunity: If you're new to the project, explore our labeled "good first issues" for beginner-friendly tasks.
  2. Understand our workflow: Review our Contributing Guide to learn about our development setup, coding standards, and pull request process.
  3. Make your impact: Contributions come in many forms—fixing bugs, enhancing documentation, improving performance, adding features, writing tests, or refining the user experience.
  4. Submit your work: When you're ready, submit a well-documented pull request, and our maintainers will provide feedback to help get your changes merged.

Your questions, insights, and ideas are always welcome!

Together, we're building something meaningful that impacts real users. We look forward to collaborating with you!

License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

Security

See CONTRIBUTING for more information.

About

A set of tools that gives agents powerful capabilities.

Resources

Code of conduct

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages