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 versionsStrands Discord

DocumentationSamplesPython SDKToolsAgent BuilderMCP Server

Strands Agents Tools is a community-driven project that 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, Amazon Bedrock Knowledge Bases, Elasticsearch, and MongoDB Atlas
  • 🕸️ Web Infrastructure - Perform web searches, extract page content, and crawl websites with Tavily and Exa-powered tools
  • 🌐 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
  • 🤖 Agent as Tool - Create nested agent instances with model switching support for multi-model workflows and specialized sub-tasks
  • 🔗 Multi-Agent Graph - Create and manage deterministic DAG-based multi-agent pipelines with output propagation and per-node model configuration
  • 🔌 Dynamic MCP Client - ⚠️ Dynamically connect to external MCP servers and load remote tools (use with caution - see security warnings)
  • 🔄 Multiple Tools per Turn - Call several other tools from one model response with Batch Tool
  • 🔍 Browser Tool - Tool giving an agent access to perform automated actions on a browser (chromium)
  • 📈 Diagram - Create AWS cloud diagrams, basic diagrams, or UML diagrams using python libraries
  • 📰 RSS Feed Manager - Subscribe, fetch, and process RSS feeds with content filtering and persistent storage
  • 🖱️ Computer Tool - Automate desktop actions including mouse movements, keyboard input, screenshots, and application management

Important

The tools in this repository are experimental. Many of them grant agents powerful capabilities — executing code, accessing the file system, calling AWS APIs, connecting to external servers, and automating browsers and desktops — which carry real security implications. Any production use should be preceded by your own independent security review; see the Responsible AI guidance for best practices. Use of these tools is at your own risk.

📦 Installation

Quick Install

pip install strands-agents-tools

To install the dependencies for optional tools:

pip install "strands-agents-tools[mem0_memory, use_browser, rss, use_computer]"

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
editor ⚠️agent.tool.editor(command="view", path="path/to/file.py")Advanced file operations like syntax highlighting, pattern replacement, and multi-file edits
Deprecated — see Deprecations
shell* ⚠️agent.tool.shell(command="ls -la")Executing shell commands, interacting with the operating system, running scripts
Deprecated — see Deprecations
http_requestagent.tool.http_request(method="GET", url="https://api.example.com/data")Making API calls, fetching web data, sending data to external services
tavily_searchagent.tool.tavily_search(query="What is artificial intelligence?", search_depth="advanced")Real-time web search optimized for AI agents with a variety of custom parameters
tavily_extractagent.tool.tavily_extract(urls=["www.tavily.com"], extract_depth="advanced")Extract clean, structured content from web pages with advanced processing and noise removal
tavily_crawlagent.tool.tavily_crawl(url="www.tavily.com", max_depth=2, instructions="Find API docs")Crawl websites intelligently starting from a base URL with filtering and extraction
tavily_mapagent.tool.tavily_map(url="www.tavily.com", max_depth=2, instructions="Find all pages")Map website structure and discover URLs starting from a base URL without content extraction
exa_searchagent.tool.exa_search(query="Best project management tools", text=True)Intelligent web search with auto mode (default) for optimal results, plus fast and deep search modes
exa_get_contentsagent.tool.exa_get_contents(urls=["https://example.com/article"], text=True, summary={"query": "key points"})Extract full content and summaries from specific URLs with live crawling fallback
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
calculator ⚠️agent.tool.calculator(expression="2 * sin(pi/4) + log(e**2)")Performing mathematical operations, symbolic math, equation solving
Deprecated — see Deprecations
code_interpretercode_interpreter = AgentCoreCodeInterpreter(region="us-west-2"); agent = Agent(tools=[code_interpreter.code_interpreter])Execute code in isolated sandbox environments with multi-language support (Python, JavaScript, TypeScript), persistent sessions, and file operations
use_awsagent.tool.use_aws(service_name="s3", operation_name="list_buckets", parameters={}, region="us-west-2")Interacting with AWS services, cloud resource management
retrieve ⚠️agent.tool.retrieve(text="What is STRANDS?")Retrieving information from Amazon Bedrock Knowledge Bases with optional metadata
Deprecated — see Deprecations
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
agent_core_memoryagent.tool.agent_core_memory(action="record", content="Hello, I like vegetarian food")Store and retrieve memories with Amazon Bedrock Agent Core Memory service
mem0_memoryagent.tool.mem0_memory(action="store", content="Remember I like to play tennis")Store user and agent memories across agent runs to provide personalized experience (tenant identity configured via Mem0MemoryTool or environment variables)
bright_dataagent.tool.bright_data(action="scrape_as_markdown", url="https://example.com")Web scraping, search queries, screenshot capture, and structured data extraction from websites and different data feeds
memory ⚠️agent.tool.memory(action="retrieve", query="product features")Store, retrieve, list, and manage documents in Amazon Bedrock Knowledge Bases with configurable parameters via environment variables
Deprecated — see Deprecations
environment ⚠️agent.tool.environment(action="list", prefix="AWS_")Managing environment variables, configuration management
Deprecated — see Deprecations
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
think ⚠️agent.tool.think(thought="Complex problem to analyze", cycle_count=3)Advanced reasoning, multi-step thinking processes
Deprecated — see Deprecations
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_time ⚠️agent.tool.current_time(timezone="US/Pacific")Get the current time in ISO 8601 format for a specified timezone
Deprecated — see Deprecations
sleep ⚠️agent.tool.sleep(seconds=5)Pause execution for the specified number of seconds, interruptible with SIGINT (Ctrl+C)
Deprecated — see Deprecations
agent_graphagent.tool.agent_graph(agents=["agent1", "agent2"], connections=[{"from": "agent1", "to": "agent2"}])Create and visualize agent relationship graphs for complex multi-agent systems
graphagent.tool.graph(action="create", graph_id="pipeline", topology={"nodes": [...], "edges": [...]})Create and manage deterministic DAG-based multi-agent graphs using Strands SDK Graph implementation with per-node model configuration
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
Deprecated — see Deprecations
slack ⚠️agent.tool.slack(action="post_message", channel="general", text="Hello team!")Interact with Slack workspace for messaging and monitoring
Deprecated — see Deprecations
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
use_agentagent.tool.use_agent(prompt="Analyze this code", system_prompt="You are a code analyst.", model_provider="bedrock")Create nested agent instances with model switching, multi-model workflows, cost optimization, and specialized sub-tasks
workflowagent.tool.workflow(action="create", name="data_pipeline", steps=[{"tool": "file_read"}, {"tool": "python_repl"}])Define, execute, and manage multi-step automated workflows
mcp_clientagent.tool.mcp_client(action="connect", connection_id="my_server", transport="stdio", command="python", args=["server.py"])⚠️SECURITY WARNING: Dynamically connect to external MCP servers via stdio, sse, or streamable_http, list tools, and call remote tools. This can pose security risks as agents may connect to malicious servers. Use with caution in production.
batch ⚠️agent.tool.batch(invocations=[{"name": "current_time", "arguments": {"timezone": "Europe/London"}}, {"name": "stop", "arguments": {}}])Call multiple other tools from one request.
Deprecated — see Deprecations
browserbrowser = LocalChromiumBrowser(); agent = Agent(tools=[browser.browser])Web scraping, automated testing, form filling, web automation tasks
diagram ⚠️agent.tool.diagram(diagram_type="cloud", nodes=[{"id": "s3", "type": "S3"}], edges=[])Create AWS cloud architecture diagrams, network diagrams, graphs, and UML diagrams (all 14 types)
Deprecated — see Deprecations
rss ⚠️agent.tool.rss(action="subscribe", url="https://example.com/feed.xml", feed_id="tech_news")Manage RSS feeds: subscribe, fetch, read, search, and update content from various sources
Deprecated — see Deprecations
use_computeragent.tool.use_computer(action="click", x=100, y=200, app_name="Chrome") Desktop automation, GUI interaction, screen capture
search_videoagent.tool.search_video(query="people discussing AI")Semantic video search using TwelveLabs' Marengo model
chat_videoagent.tool.chat_video(prompt="What are the main topics?", video_id="video_123")Interactive video analysis using TwelveLabs' Pegasus model
mongodb_memoryagent.tool.mongodb_memory(action="record", content="User prefers vegetarian pizza")Store and retrieve memories using MongoDB Atlas with semantic search via AWS Bedrock Titan embeddings (connection and namespace configured via MongoDBMemoryTool or environment variables)
elasticsearch_memoryagent.tool.elasticsearch_memory(action="record", content="User prefers dark mode")Store and retrieve memories using Elasticsearch with semantic search via AWS Bedrock Titan embeddings (connection and namespace configured via ElasticsearchMemoryTool or environment variables)

* These tools do not work on Windows

Deprecations

The tools below are deprecated, and each row points to where that capability now lives.

When this package started, the SDK had no built-in way to do most of these things, so we shipped tools to fill the gap. Much of that is now native: the SDK reasons, injects context, manages memory, and runs tools concurrently on its own, and where a vendor maintains an official MCP server, that server will always track their API better than a wrapper here can. Keeping a second implementation alongside means two things to fix and two things to drift, so we would rather point you at the one that gets the attention.

More tools will follow as their capabilities land elsewhere, and this repository will eventually be archived. Nothing breaks suddenly — but migrating when a tool is first deprecated is easier than moving several at once later.

Deprecated tools keep working. Each one logs a warning when invoked starting in v0.8.6, and that warning becomes an error log in v0.9.0 — a louder signal for anyone who has not migrated, not a behavior change.

They are also marked with @typing_extensions.deprecated, so type checkers and IDEs flag usage before you run anything. To list what you still need to migrate, run mypy --enable-error-code deprecated over your project: it reports the from strands_tools import ... line for each deprecated tool, without invoking any of them. Prefer mypy here: pyright, with reportDeprecated enabled, reports direct calls such as calculator(expression=...) but not agent.tool.calculator(...), and it reaches the import line for only the three tools whose marker is not wrapped by @tool. Note that Python suppresses the resulting DeprecationWarning at runtime when the agent invokes a tool, which is why the log message exists as well.

ToolSuggested alternativeWarningError log
sleepfrom strands.vended_tools import sleepv0.8.6v0.9.0
editorfrom strands.vended_tools import file_editorv0.8.6v0.9.0
shellfrom strands.vended_tools import bashv0.8.6v0.9.0
batchnone needed — concurrent tool execution is the SDK default (docs)v0.8.6v0.9.0
thinknative extended thinking via model reasoning config (docs)v0.8.6v0.9.0
current_timeContextInjector (docs)v0.8.6v0.9.0
memoryMemoryManager + BedrockKnowledgeBaseStore (docs)v0.8.6v0.9.0
retrieveMemoryManager + BedrockKnowledgeBaseStore(writable=False) (docs)v0.8.6v0.9.0
calculatorfrom strands.vended_tools import bash (run python3 -c with sympy)v0.8.6v0.9.0
cronfrom strands.vended_tools import bash (manage crontab), or Amazon EventBridge Schedulerv0.8.6v0.9.0
environmentfrom strands.vended_tools import bash (inspect only, see notes)v0.8.6v0.9.0
slackofficial Slack MCP server; slack_bolt for Socket Modev0.8.6v0.9.0
diagramno replacement — have the model write graphviz/mermaid/diagrams code directlyv0.8.6v0.9.0
rssno replacement — parse feeds directly with feedparserv0.8.6v0.9.0
# BeforefromstrandsimportAgentfromstrands_toolsimporteditor, shell, sleepagent=Agent(tools=[editor, shell, sleep])
# AfterfromstrandsimportAgentfromstrands.vended_toolsimportbash, file_editor, sleepagent=Agent(tools=[bash, file_editor, sleep])

Behavior differences

The replacements are not drop-in equivalents. Check these before migrating:

  • shellbash: the SDK tool routes commands through the agent's configured sandbox and is stateless — each call runs in a fresh shell, so variables and the working directory do not persist between calls. It does not provide PTY support or batched parallel/sequential command execution.
  • editorfile_editor: supports view, create, str_replace, and insert. The pattern_replace, find_line, and undo_edit commands have no SDK equivalent.
  • sleepsleep: the maximum duration is set with make_sleep(max_duration=...) and defaults to 60 seconds, replacing the MAX_SLEEP_SECONDS environment variable which defaulted to 300 seconds.
  • batch — you can drop it. The SDK runs tool calls concurrently by default via ConcurrentToolExecutor, which also keeps tracing, metrics, and hooks intact. See Tool executors.
  • think → extended thinking — reasoning is now a model capability rather than a tool, so you configure it once instead of prompting for it. It is single-pass, so if you were relying on cycle_count to refine across passes, or on tool calls inside the reasoning loop, that pattern moves into your own orchestration. Config is per provider — see Amazon Bedrock.
  • current_timeContextInjector — the date is context, not something the agent should have to ask for, so injecting it means it is always fresh and the model cannot forget to call it. The trade-off is that your code picks the timezone; if you need the model to choose one per call, the official MCP time server still does that. See ContextInjector.
  • memory / retrieve → memory stores — memory is a first-class SDK concept now, so stores plug into the agent and inject context automatically instead of waiting to be called. store/retrieve become add/search. list, get, and delete are not part of the store protocol, so keep them as backend-native tools via get_tools(). One thing to know: the store returns relevance scores but does not filter on them, so if you relied on retrieve's default score >= 0.4 floor, apply it yourself. See Bedrock Knowledge Base store and Custom stores.
  • calculatorshell — run python3 -c with sympy for the same symbolic math. Worth being explicit: shell runs whatever it is given, whereas this tool checked expressions against an allowlist first. If you are evaluating untrusted input, put a sandbox behind the shell tool or keep your own validation in front of it.
  • cronshellcrontab through the shell tool covers scheduling on a host. Two things to plan for: the shell is sandbox-routed, so under Docker or SSH your jobs land in an environment that may not have a cron daemon, and you will be composing crontab lines yourself rather than using structured list/add/remove/edit actions. For scheduling that outlives the host, Amazon EventBridge Scheduler is usually the better fit.
  • environmentshellenv and printenv cover reading. Setting is genuinely different: a child shell cannot change the agent's own process environment, so variables need to be set where the agent is launched, or passed per call. If you were leaning on PROTECTED_VARS or secret masking, that guarding moves to your side.
  • slack → Slack's official MCP server — Slack maintains it, so it tracks their API directly, and it uses OAuth rather than long-lived tokens. It exposes a curated tool set rather than this tool's passthrough to any Web API method, and being request/response it does not cover Socket Mode or real-time events — slack_bolt remains the right tool for event listeners. Endpoint and setup: docs.slack.dev/ai/mcp-server.
  • diagram — no direct replacement, and that is deliberate: this tool was a wrapper over graphviz and the diagrams package, and a capable model writes that code well on its own. The wrapper mostly added a layer to keep in sync.
  • rss — no direct replacement. Fetching and parsing a feed is a few lines of feedparser, and the subscription list was a JSON file. If you were using feed HTTP Basic auth or the stored subscriptions, those move into your code.

💻 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")

Dynamic MCP Client Integration

⚠️SECURITY WARNING: The Dynamic MCP Client allows agents to autonomously connect to external MCP servers and load remote tools at runtime. This poses significant security risks as agents can potentially connect to malicious servers and execute untrusted code. Use with extreme caution in production environments.

This tool is different from the static MCP server implementation in the Strands SDK (see MCP Tools Documentation) which uses pre-configured, trusted MCP servers.

fromstrandsimportAgentfromstrands_toolsimportmcp_clientagent=Agent(tools=[mcp_client])
# Connect to a custom MCP server via stdioagent.tool.mcp_client(
action="connect",
connection_id="my_tools",
transport="stdio",
command="python",
args=["my_mcp_server.py"]
)
# List available tools on the servertools=agent.tool.mcp_client(
action="list_tools",
connection_id="my_tools"
)
# Call a tool from the MCP serverresult=agent.tool.mcp_client(
action="call_tool",
connection_id="my_tools",
tool_name="calculate",
tool_args={"x": 10, "y": 20}
)
# Connect to a SSE-based serveragent.tool.mcp_client(
action="connect",
connection_id="web_server",
transport="sse",
server_url="http://localhost:8080/sse"
)
# Connect to a streamable HTTP serveragent.tool.mcp_client(
action="connect",
connection_id="http_server",
transport="streamable_http",
server_url="https://api.example.com/mcp",
headers={"Authorization": "Bearer token"},
timeout=60
)
# Load MCP tools into agent's registry for direct access# ⚠️ WARNING: This loads external tools directly into the agentagent.tool.mcp_client(
action="load_tools",
connection_id="my_tools"
)
# Now you can call MCP tools directly as: agent.tool.calculate(x=10, y=20)

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
)

Tavily Search, Extract, Crawl, and Map

fromstrandsimportAgentfromstrands_tools.tavilyimport (
tavily_search, tavily_extract, tavily_crawl, tavily_map
)
# For async usage, call the corresponding *_async function with await.# Synchronous usage agent=Agent(tools=[tavily_search, tavily_extract, tavily_crawl, tavily_map])
# Real-time web searchresult=agent.tool.tavily_search(
query="Latest developments in renewable energy",
search_depth="advanced",
topic="news",
max_results=10,
include_raw_content=True
)
# Extract content from multiple URLsresult=agent.tool.tavily_extract(
urls=["www.tavily.com", "www.apple.com"],
extract_depth="advanced",
format="markdown"
)
# Advanced crawl with instructions and filteringresult=agent.tool.tavily_crawl(
url="www.tavily.com",
max_depth=2,
limit=50,
instructions="Find all API documentation and developer guides",
extract_depth="advanced",
include_images=True
)
# Basic website mappingresult=agent.tool.tavily_map(url="www.tavily.com")

Exa Search and Contents

fromstrandsimportAgentfromstrands_tools.exaimportexa_search, exa_get_contentsagent=Agent(tools=[exa_search, exa_get_contents])
# Basic search (auto mode is default and recommended)result=agent.tool.exa_search(
query="Best project management software",
text=True
)
# Company-specific search when neededresult=agent.tool.exa_search(
query="Anthropic AI safety research",
category="company",
include_domains=["anthropic.com"],
num_results=5,
summary={"query": "key research areas and findings"}
)
# News search with date filteringresult=agent.tool.exa_search(
query="AI regulation policy updates",
category="news",
start_published_date="2024-01-01T00:00:00.000Z",
text=True
)
# Get detailed content from specific URLsresult=agent.tool.exa_get_contents(
urls=[
"https://example.com/blog-post",
"https://github.com/microsoft/semantic-kernel"
],
text={"maxCharacters": 5000, "includeHtmlTags": False},
summary={
"query": "main points and practical applications"
},
subpages=2,
extras={"links": 5, "imageLinks": 2}
)
# Structured summary with JSON schemaresult=agent.tool.exa_get_contents(
urls=["https://example.com/article"],
summary={
"query": "main findings and recommendations",
"schema": {
"type": "object",
"properties": {
"main_points": {"type": "string", "description": "Key points from the article"},
"recommendations": {"type": "string", "description": "Suggested actions or advice"},
"conclusion": {"type": "string", "description": "Overall conclusion"},
"relevance": {"type": "string", "description": "Why this matters"}
},
"required": ["main_points", "conclusion"]
}
}
)

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()""")

Code Interpreter

fromstrandsimportAgentfromstrands_tools.code_interpreterimportAgentCoreCodeInterpreter# Create the code interpreter toolbedrock_agent_core_code_interpreter=AgentCoreCodeInterpreter(region="us-west-2")
agent=Agent(tools=[bedrock_agent_core_code_interpreter.code_interpreter])
# Create a sessionagent.tool.code_interpreter({
"action": {
"type": "initSession",
"description": "Data analysis session",
"session_name": "analysis-session"
}
})
# Execute Python codeagent.tool.code_interpreter({
"action": {
"type": "executeCode",
"session_name": "analysis-session",
"code": "print('Hello from sandbox!')",
"language": "python"
}
})

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"
)

Retrieve Tool

fromstrandsimportAgentfromstrands_toolsimportretrieveagent=Agent(tools=[retrieve])
# Basic retrieval without metadataresult=agent.tool.retrieve(
text="What is artificial intelligence?"
)
# Retrieval with metadata enabledresult=agent.tool.retrieve(
text="What are the latest developments in machine learning?",
enableMetadata=True
)
# Using environment variable to set default metadata behavior# Set RETRIEVE_ENABLE_METADATA_DEFAULT=true in your environmentresult=agent.tool.retrieve(
text="Tell me about cloud computing"# enableMetadata will default to the environment variable value
)

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"
}
},
]
)

Video Tools

fromstrandsimportAgentfromstrands_toolsimportsearch_video, chat_videoagent=Agent(tools=[search_video, chat_video])
# Search for video content using natural languageresult=agent.tool.search_video(
query="people discussing AI technology",
threshold="high",
group_by="video",
page_limit=5
)
# Chat with existing video (no index_id needed)result=agent.tool.chat_video(
prompt="What are the main topics discussed in this video?",
video_id="existing-video-id"
)
# Chat with new video file (index_id required for upload)result=agent.tool.chat_video(
prompt="Describe what happens in this video",
video_path="/path/to/video.mp4",
index_id="your-index-id"# or set TWELVELABS_PEGASUS_INDEX_ID env var
)

AgentCore Memory

fromstrandsimportAgentfromstrands_tools.agent_core_memoryimportAgentCoreMemoryToolProviderprovider=AgentCoreMemoryToolProvider(
memory_id="memory-123abc", # Requiredactor_id="user-456", # Requiredsession_id="session-789", # Requirednamespace="default", # Requiredregion="us-west-2"# Optional, defaults to us-west-2
)
agent=Agent(tools=provider.tools)
# Create a new memoryresult=agent.tool.agent_core_memory(
action="record",
content="I am allergic to shellfish"
)
# Search for relevant memoriesresult=agent.tool.agent_core_memory(
action="retrieve",
query="user preferences"
)
# List all memoriesresult=agent.tool.agent_core_memory(
action="list"
)
# Get a specific memory by IDresult=agent.tool.agent_core_memory(
action="get",
memory_record_id="mr-12345"
)

Browser

fromstrandsimportAgentfromstrands_tools.browserimportLocalChromiumBrowser# Create browser toolbrowser=LocalChromiumBrowser()
agent=Agent(tools=[browser.browser])
# Simple navigationresult=agent.tool.browser({
"action": {
"type": "navigate",
"url": "https://example.com"
}
})
# Initialize a session firstresult=agent.tool.browser({
"action": {
"type": "initSession",
"session_name": "main-session",
"description": "Web automation session"
}
})

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
)

Use Agent (Agent as Tool)

fromstrandsimportAgentfromstrands_toolsimportuse_agentagent=Agent(tools=[use_agent])
# Basic usage - inherits parent agent's modelresult=agent.tool.use_agent(
prompt="Tell me about the advantages of tool-building in AI agents",
system_prompt="You are a helpful AI assistant specializing in AI development concepts."
)
# Use a different model provider for specialized tasksresult=agent.tool.use_agent(
prompt="Calculate 2 + 2 and explain the result",
system_prompt="You are a helpful math assistant.",
model_provider="bedrock",
model_settings={
"model_id": "us.anthropic.claude-sonnet-4-20250514-v1:0"
},
tools=["calculator"]
)
# Use environment variables to determine modelimportosos.environ["STRANDS_PROVIDER"] ="ollama"os.environ["STRANDS_MODEL_ID"] ="qwen3:4b"result=agent.tool.use_agent(
prompt="Analyze this code",
system_prompt="You are a code review assistant.",
model_provider="env"
)
# Custom model configuration with specific parametersresult=agent.tool.use_agent(
prompt="Write a creative story",
system_prompt="You are a creative writing assistant.",
model_provider="github",
model_settings={
"model_id": "openai/o4-mini",
"params": {"temperature": 1, "max_tokens": 4000}
}
)

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

Diagram

fromstrandsimportAgentfromstrands_toolsimportdiagramagent=Agent(tools=[diagram])
# Create an AWS cloud architecture diagramresult=agent.tool.diagram(
diagram_type="cloud",
nodes=[
{"id": "users", "type": "Users", "label": "End Users"},
{"id": "cloudfront", "type": "CloudFront", "label": "CDN"},
{"id": "s3", "type": "S3", "label": "Static Assets"},
{"id": "api", "type": "APIGateway", "label": "API Gateway"},
{"id": "lambda", "type": "Lambda", "label": "Backend Service"}
],
edges=[
{"from": "users", "to": "cloudfront"},
{"from": "cloudfront", "to": "s3"},
{"from": "users", "to": "api"},
{"from": "api", "to": "lambda"}
],
title="Web Application Architecture"
)
# Create a UML class diagramresult=agent.tool.diagram(
diagram_type="class",
elements=[
{
"name": "User",
"attributes": ["+id: int", "-name: string", "#email: string"],
"methods": ["+login(): bool", "+logout(): void"]
},
{
"name": "Order",
"attributes": ["+id: int", "-items: List", "-total: float"],
"methods": ["+addItem(item): void", "+calculateTotal(): float"]
}
],
relationships=[
{"from": "User", "to": "Order", "type": "association", "multiplicity": "1..*"}
],
title="E-commerce Domain Model"
)

RSS Feed Management

fromstrandsimportAgentfromstrands_toolsimportrssagent=Agent(tools=[rss])
# Subscribe to a feedresult=agent.tool.rss(
action="subscribe",
url="https://news.example.com/rss/technology"
)
# List all subscribed feedsfeeds=agent.tool.rss(action="list")
# Read entries from a specific feedentries=agent.tool.rss(
action="read",
feed_id="news_example_com_technology",
max_entries=5,
include_content=True
)
# Search across all feedssearch_results=agent.tool.rss(
action="search",
query="machine learning",
max_entries=10
)
# Fetch feed content without subscribinglatest_news=agent.tool.rss(
action="fetch",
url="https://blog.example.org/feed",
max_entries=3
)

Use Computer

fromstrandsimportAgentfromstrands_toolsimportuse_computeragent=Agent(tools=[use_computer])
# Find mouse positionresult=agent.tool.use_computer(action="mouse_position")
# Automate adding textresult=agent.tool.use_computer(action="type", text="Hello, world!", app_name="Notepad")
# Analyze current computer screenresult=agent.tool.use_computer(action="analyze_screen")
result=agent.tool.use_computer(action="open_app", app_name="Calculator")
result=agent.tool.use_computer(action="close_app", app_name="Calendar")
result=agent.tool.use_computer(
action="hotkey",
hotkey_str="command+ctrl+f", # For macOSapp_name="Chrome"
)

Graph (Multi-Agent DAG)

Create deterministic DAG-based multi-agent pipelines where agents are nodes with dependency relationships. Unlike agent_graph (which uses persistent message-passing), graph uses task-based execution with output propagation.

fromstrandsimportAgentfromstrands_tools.graphimportgraphagent=Agent(tools=[graph])
# Create a multi-agent research pipelineresult=agent.tool.graph(
action="create",
graph_id="research_pipeline",
topology={
"nodes": [
{
"id": "researcher",
"role": "researcher",
"system_prompt": "You research topics thoroughly.",
"model_provider": "bedrock",
"model_settings": {"model_id": "us.anthropic.claude-sonnet-4-20250514-v1:0"}
},
{
"id": "analyst",
"role": "analyst",
"system_prompt": "You analyze research data.",
"model_provider": "bedrock",
"model_settings": {"model_id": "us.anthropic.claude-3-5-haiku-20241022-v1:0"}
},
{
"id": "reporter",
"role": "reporter",
"system_prompt": "You create comprehensive reports.",
"tools": ["file_write", "editor"]
}
],
"edges": [
{"from": "researcher", "to": "analyst"},
{"from": "analyst", "to": "reporter"}
],
"entry_points": ["researcher"]
}
)
# Execute a task through the graphresult=agent.tool.graph(
action="execute",
graph_id="research_pipeline",
task="Research and analyze the impact of AI on healthcare"
)
# Get graph statusresult=agent.tool.graph(action="status", graph_id="research_pipeline")
# List all graphsresult=agent.tool.graph(action="list")
# Delete a graphresult=agent.tool.graph(action="delete", graph_id="research_pipeline")

Elasticsearch Memory

Note: This tool requires AWS account credentials to generate embeddings using Amazon Bedrock Titan models.

fromstrandsimportAgentfromstrands_tools.elasticsearch_memoryimportElasticsearchMemoryTool, elasticsearch_memory# Bind connection, index, and namespace per principal (kept out of the agent-facing tool)memory_tool=ElasticsearchMemoryTool(
cloud_id="your-elasticsearch-cloud-id", # or es_url="https://...:443" for Serverlessapi_key="your-api-key",
index_name="memories",
namespace="user_123",
)
agent=Agent(tools=[memory_tool.elasticsearch_memory])
# Store a memory with semantic embeddingsresult=agent.tool.elasticsearch_memory(
action="record",
content="User prefers vegetarian pizza with extra cheese",
metadata={"category": "food_preferences", "type": "dietary"},
)
# Search memories using semantic similarity (vector search)result=agent.tool.elasticsearch_memory(
action="retrieve",
query="food preferences and dietary restrictions",
max_results=5,
)
# List all memories with paginationresult=agent.tool.elasticsearch_memory(action="list", max_results=10)
# Get specific memory by IDresult=agent.tool.elasticsearch_memory(action="get", memory_id="mem_1234567890_abcd1234")
# Delete a memoryresult=agent.tool.elasticsearch_memory(action="delete", memory_id="mem_1234567890_abcd1234")
# Single-tenant: use the standalone tool with configuration from environment variablesagent=Agent(tools=[elasticsearch_memory])
result=agent.tool.elasticsearch_memory(action="record", content="User prefers vegetarian pizza")

MongoDB Atlas Memory

Note: This tool requires AWS account credentials to generate embeddings using Amazon Bedrock Titan models.

fromstrandsimportAgentfromstrands_tools.mongodb_memoryimportMongoDBMemoryTool, mongodb_memory# Bind connection, collection, and namespace per principal (kept out of the agent-facing tool)memory_tool=MongoDBMemoryTool(
cluster_uri="mongodb+srv://username:password@cluster0.mongodb.net/?retryWrites=true&w=majority",
database_name="memories",
collection_name="user_memories",
namespace="user_123",
)
agent=Agent(tools=[memory_tool.mongodb_memory])
# Store a memory with semantic embeddingsresult=agent.tool.mongodb_memory(
action="record",
content="User prefers vegetarian pizza with extra cheese",
metadata={"category": "food_preferences", "type": "dietary"},
)
# Search memories using semantic similarity (vector search)result=agent.tool.mongodb_memory(
action="retrieve",
query="food preferences and dietary restrictions",
max_results=5,
)
# List all memories with paginationresult=agent.tool.mongodb_memory(action="list", max_results=10)
# Get specific memory by IDresult=agent.tool.mongodb_memory(action="get", memory_id="mem_1234567890_abcd1234")
# Delete a memoryresult=agent.tool.mongodb_memory(action="delete", memory_id="mem_1234567890_abcd1234")
# Single-tenant: use the standalone tool with configuration from environment variablesagent=Agent(tools=[mongodb_memory])
result=agent.tool.mongodb_memory(action="record", content="User prefers vegetarian pizza")

🌍 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_NON_INTERACTIVERun tools without interactive prompts, set to "true" to suppress confirmation dialogsfalseTools with a confirmation prompt (e.g. shell, 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

Tavily Search, Extract, Crawl, and Map Tools

Environment VariableDescriptionDefault
TAVILY_API_KEYTavily API key (required for all Tavily functionality)None

Exa Search and Contents Tools

Environment VariableDescriptionDefault
EXA_API_KEYExa API key (required for all Exa functionality)None

Mem0 Memory Tool

Security Model: The tenant-isolation keys (user_id / agent_id) are never exposed as agent-facing tool parameters. The agent only chooses the action and its content/query/memory_id. This prevents a model (or prompt-injected content) from reading, writing, or deleting another tenant's memories.

Usage patterns:

fromstrandsimportAgentfromstrands_tools.mem0_memoryimportMem0MemoryTool, mem0_memory# Multi-tenant (recommended): bind identity per authenticated principaltool=Mem0MemoryTool(user_id=f"user_{authenticated_user_id}")
agent=Agent(tools=[tool.mem0_memory])
agent.tool.mem0_memory(action="store", content="User prefers vegetarian pizza")
# Single-tenant: use the standalone function with env vars (MEM0_USER_ID / MEM0_AGENT_ID)agent=Agent(tools=[mem0_memory])
agent.tool.mem0_memory(action="store", content="User prefers vegetarian pizza")

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
  4. Neptune Analytics (Optional Graph backend for search enhancement):

    • Uses Neptune Analytics as the graph store backend to enhance memory recall.
    • Requires AWS credentials and Neptune Analytics configuration
    # Configure your Neptune Analytics graph ID in the .env file:
    export NEPTUNE_ANALYTICS_GRAPH_IDENTIFIER=sample-graph-id
    # Configure your Neptune Analytics graph ID in Python code:
    import os
    os.environ['NEPTUNE_ANALYTICS_GRAPH_IDENTIFIER'] = "g-sample-graph-id"
    
Environment VariableDescriptionDefaultRequired For
MEM0_USER_IDUser ID for memory operations (standalone function)NoneStandalone
MEM0_AGENT_IDAgent ID for memory operations (standalone function)NoneStandalone
MEM0_API_KEYMem0 Platform API keyNoneMem0 Platform
OPENSEARCH_HOSTOpenSearch Host URLNoneOpenSearch
AWS_REGIONAWS Region for OpenSearchus-west-2OpenSearch
NEPTUNE_ANALYTICS_GRAPH_IDENTIFIERNeptune Analytics Graph IdentifierNoneNeptune Analytics
DEVEnable development mode (bypasses confirmations)falseAll modes
MEM0_LLM_PROVIDERLLM provider for memory processingaws_bedrockAll modes
MEM0_LLM_MODELLLM model for memory processinganthropic.claude-3-5-haiku-20241022-v1:0All modes
MEM0_LLM_TEMPERATURELLM temperature (0.0-2.0)0.1All modes
MEM0_LLM_MAX_TOKENSLLM maximum tokens2000All modes
MEM0_EMBEDDER_PROVIDEREmbedder provider for vector embeddingsaws_bedrockAll modes
MEM0_EMBEDDER_MODELEmbedder model for vector embeddingsamazon.titan-embed-text-v2:0All 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)
  • If NEPTUNE_ANALYTICS_GRAPH_IDENTIFIER is set, the tool will configure Neptune Analytics as graph store to enhance memory search
  • LLM configuration applies to all backend modes and allows customization of the language model used for memory processing

Bright Data Tool

Environment VariableDescriptionDefault
BRIGHTDATA_API_KEYBright Data API KeyNone
BRIGHTDATA_ZONEBright Data Web Unlocker Zoneweb_unlocker1

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
PYTHON_REPL_INTERACTIVEWhether to enable interactive PTY modeNone
PYTHON_REPL_RESET_STATEWhether to reset the REPL state before executionNone
PYTHON_REPL_PERSISTENCE_DIRSet Directory for python_repl tool to write state fileNone

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
EDITOR_DISABLE_BACKUPSkip creating .bak backup files during edit operationsfalse

Environment Tool

Environment VariableDescriptionDefault
ENV_VARS_MASKED_DEFAULTMasking of values whose name contains TOKEN, SECRET, PASSWORD, KEY, or AUTH. Set to false to disable. This is the only way to configure masking: the agent cannot override it through tool input, and the environment tool cannot set it. Tools that execute arbitrary code in the agent process, such as python_repl and shell, can still write ittrue

HTTP Request Tool

Environment VariableDescriptionDefault
STRANDS_HTTP_ALLOW_INSECURE_SSLAllow disabling SSL certificate verification via verify_ssl parameterfalse

Dynamic MCP Client Tool

Environment VariableDescriptionDefault
STRANDS_MCP_TIMEOUTDefault timeout in seconds for MCP operations30.0

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

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

RSS Tool

Environment VariableDescriptionDefault
STRANDS_RSS_MAX_ENTRIESDefault setting for maximum number of entries per feed100
STRANDS_RSS_UPDATE_INTERVALDefault amount of time between updating rss feeds in minutes60
STRANDS_RSS_STORAGE_PATHDefault storage path where rss feeds are stored locallystrands_rss_feeds (this may vary based on your system)

Retrieve Tool

Environment VariableDescriptionDefault
RETRIEVE_ENABLE_METADATA_DEFAULTDefault setting for enabling metadata in retrieve tool responsesfalse

Use Agent Tool

Environment VariableDescriptionDefault
STRANDS_PROVIDERDefault model provider when using model_provider="env"ollama
STRANDS_MODEL_IDDefault model identifier for environment-based model selectionNone
STRANDS_MAX_TOKENSMaximum tokens for the nested agent modelNone
STRANDS_TEMPERATURESampling temperature for the nested agent modelNone

Elasticsearch Memory Tool

Environment VariableDescriptionDefault
ELASTICSEARCH_CLOUD_IDElasticsearch Cloud ID for connectionNone
ELASTICSEARCH_URLElasticsearch URL for serverless connectionNone
ELASTICSEARCH_API_KEYElasticsearch API key for authenticationNone
ELASTICSEARCH_INDEX_NAMEElasticsearch index name for memory storagestrands_memory
ELASTICSEARCH_NAMESPACENamespace for memory isolationdefault
ELASTICSEARCH_EMBEDDING_MODELAmazon Bedrock model for embeddingsamazon.titan-embed-text-v2:0
AWS_REGIONAWS region for Bedrock embedding serviceus-west-2

Note: This tool requires AWS account credentials to generate embeddings using Amazon Bedrock Titan models.

Graph Tool

The graph tool uses the same model provider environment variables as use_agent for per-node model configuration. No additional environment variables are required.

Video Tools

Environment VariableDescriptionDefault
TWELVELABS_API_KEYTwelveLabs API key for video analysisNone
TWELVELABS_MARENGO_INDEX_IDDefault index ID for search_video toolNone
TWELVELABS_PEGASUS_INDEX_IDDefault index ID for chat_video toolNone

MongoDB Atlas Memory Tool

Environment VariableDescriptionDefault
MONGODB_ATLAS_CLUSTER_URIMongoDB Atlas connection stringNone
MONGODB_DATABASE_NAMEDatabase name for MongoDB operationsstrands_memory
MONGODB_COLLECTION_NAMECollection name for MongoDB operationsmemories
MONGODB_NAMESPACENamespace for memory isolationdefault
MONGODB_EMBEDDING_MODELAmazon Bedrock model for embeddingsamazon.titan-embed-text-v2:0

Note: This tool requires AWS account credentials to generate embeddings using Amazon Bedrock Titan models.

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!

Stay in touch with the team

Come meet the Strands team and other users on Discord

License

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

Security

The tools in this repository are experimental and are provided as-is. Any production use should be preceded by an independent security review of the specific tools you enable.

For guidance on building and deploying agents safely, see Responsible AI in the Strands Agents documentation.

To report a security issue, 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 versionsStrands Discord

DocumentationSamplesPython SDKToolsAgent BuilderMCP Server

Strands Agents Tools is a community-driven project that 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, Amazon Bedrock Knowledge Bases, Elasticsearch, and MongoDB Atlas
  • 🕸️ Web Infrastructure - Perform web searches, extract page content, and crawl websites with Tavily and Exa-powered tools
  • 🌐 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
  • 🤖 Agent as Tool - Create nested agent instances with model switching support for multi-model workflows and specialized sub-tasks
  • 🔗 Multi-Agent Graph - Create and manage deterministic DAG-based multi-agent pipelines with output propagation and per-node model configuration
  • 🔌 Dynamic MCP Client - ⚠️ Dynamically connect to external MCP servers and load remote tools (use with caution - see security warnings)
  • 🔄 Multiple Tools per Turn - Call several other tools from one model response with Batch Tool
  • 🔍 Browser Tool - Tool giving an agent access to perform automated actions on a browser (chromium)
  • 📈 Diagram - Create AWS cloud diagrams, basic diagrams, or UML diagrams using python libraries
  • 📰 RSS Feed Manager - Subscribe, fetch, and process RSS feeds with content filtering and persistent storage
  • 🖱️ Computer Tool - Automate desktop actions including mouse movements, keyboard input, screenshots, and application management

Important

The tools in this repository are experimental. Many of them grant agents powerful capabilities — executing code, accessing the file system, calling AWS APIs, connecting to external servers, and automating browsers and desktops — which carry real security implications. Any production use should be preceded by your own independent security review; see the Responsible AI guidance for best practices. Use of these tools is at your own risk.

📦 Installation

Quick Install

pip install strands-agents-tools

To install the dependencies for optional tools:

pip install "strands-agents-tools[mem0_memory, use_browser, rss, use_computer]"

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
editor ⚠️agent.tool.editor(command="view", path="path/to/file.py")Advanced file operations like syntax highlighting, pattern replacement, and multi-file edits
Deprecated — see Deprecations
shell* ⚠️agent.tool.shell(command="ls -la")Executing shell commands, interacting with the operating system, running scripts
Deprecated — see Deprecations
http_requestagent.tool.http_request(method="GET", url="https://api.example.com/data")Making API calls, fetching web data, sending data to external services
tavily_searchagent.tool.tavily_search(query="What is artificial intelligence?", search_depth="advanced")Real-time web search optimized for AI agents with a variety of custom parameters
tavily_extractagent.tool.tavily_extract(urls=["www.tavily.com"], extract_depth="advanced")Extract clean, structured content from web pages with advanced processing and noise removal
tavily_crawlagent.tool.tavily_crawl(url="www.tavily.com", max_depth=2, instructions="Find API docs")Crawl websites intelligently starting from a base URL with filtering and extraction
tavily_mapagent.tool.tavily_map(url="www.tavily.com", max_depth=2, instructions="Find all pages")Map website structure and discover URLs starting from a base URL without content extraction
exa_searchagent.tool.exa_search(query="Best project management tools", text=True)Intelligent web search with auto mode (default) for optimal results, plus fast and deep search modes
exa_get_contentsagent.tool.exa_get_contents(urls=["https://example.com/article"], text=True, summary={"query": "key points"})Extract full content and summaries from specific URLs with live crawling fallback
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
calculator ⚠️agent.tool.calculator(expression="2 * sin(pi/4) + log(e**2)")Performing mathematical operations, symbolic math, equation solving
Deprecated — see Deprecations
code_interpretercode_interpreter = AgentCoreCodeInterpreter(region="us-west-2"); agent = Agent(tools=[code_interpreter.code_interpreter])Execute code in isolated sandbox environments with multi-language support (Python, JavaScript, TypeScript), persistent sessions, and file operations
use_awsagent.tool.use_aws(service_name="s3", operation_name="list_buckets", parameters={}, region="us-west-2")Interacting with AWS services, cloud resource management
retrieve ⚠️agent.tool.retrieve(text="What is STRANDS?")Retrieving information from Amazon Bedrock Knowledge Bases with optional metadata
Deprecated — see Deprecations
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
agent_core_memoryagent.tool.agent_core_memory(action="record", content="Hello, I like vegetarian food")Store and retrieve memories with Amazon Bedrock Agent Core Memory service
mem0_memoryagent.tool.mem0_memory(action="store", content="Remember I like to play tennis")Store user and agent memories across agent runs to provide personalized experience (tenant identity configured via Mem0MemoryTool or environment variables)
bright_dataagent.tool.bright_data(action="scrape_as_markdown", url="https://example.com")Web scraping, search queries, screenshot capture, and structured data extraction from websites and different data feeds
memory ⚠️agent.tool.memory(action="retrieve", query="product features")Store, retrieve, list, and manage documents in Amazon Bedrock Knowledge Bases with configurable parameters via environment variables
Deprecated — see Deprecations
environment ⚠️agent.tool.environment(action="list", prefix="AWS_")Managing environment variables, configuration management
Deprecated — see Deprecations
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
think ⚠️agent.tool.think(thought="Complex problem to analyze", cycle_count=3)Advanced reasoning, multi-step thinking processes
Deprecated — see Deprecations
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_time ⚠️agent.tool.current_time(timezone="US/Pacific")Get the current time in ISO 8601 format for a specified timezone
Deprecated — see Deprecations
sleep ⚠️agent.tool.sleep(seconds=5)Pause execution for the specified number of seconds, interruptible with SIGINT (Ctrl+C)
Deprecated — see Deprecations
agent_graphagent.tool.agent_graph(agents=["agent1", "agent2"], connections=[{"from": "agent1", "to": "agent2"}])Create and visualize agent relationship graphs for complex multi-agent systems
graphagent.tool.graph(action="create", graph_id="pipeline", topology={"nodes": [...], "edges": [...]})Create and manage deterministic DAG-based multi-agent graphs using Strands SDK Graph implementation with per-node model configuration
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
Deprecated — see Deprecations
slack ⚠️agent.tool.slack(action="post_message", channel="general", text="Hello team!")Interact with Slack workspace for messaging and monitoring
Deprecated — see Deprecations
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
use_agentagent.tool.use_agent(prompt="Analyze this code", system_prompt="You are a code analyst.", model_provider="bedrock")Create nested agent instances with model switching, multi-model workflows, cost optimization, and specialized sub-tasks
workflowagent.tool.workflow(action="create", name="data_pipeline", steps=[{"tool": "file_read"}, {"tool": "python_repl"}])Define, execute, and manage multi-step automated workflows
mcp_clientagent.tool.mcp_client(action="connect", connection_id="my_server", transport="stdio", command="python", args=["server.py"])⚠️SECURITY WARNING: Dynamically connect to external MCP servers via stdio, sse, or streamable_http, list tools, and call remote tools. This can pose security risks as agents may connect to malicious servers. Use with caution in production.
batch ⚠️agent.tool.batch(invocations=[{"name": "current_time", "arguments": {"timezone": "Europe/London"}}, {"name": "stop", "arguments": {}}])Call multiple other tools from one request.
Deprecated — see Deprecations
browserbrowser = LocalChromiumBrowser(); agent = Agent(tools=[browser.browser])Web scraping, automated testing, form filling, web automation tasks
diagram ⚠️agent.tool.diagram(diagram_type="cloud", nodes=[{"id": "s3", "type": "S3"}], edges=[])Create AWS cloud architecture diagrams, network diagrams, graphs, and UML diagrams (all 14 types)
Deprecated — see Deprecations
rss ⚠️agent.tool.rss(action="subscribe", url="https://example.com/feed.xml", feed_id="tech_news")Manage RSS feeds: subscribe, fetch, read, search, and update content from various sources
Deprecated — see Deprecations
use_computeragent.tool.use_computer(action="click", x=100, y=200, app_name="Chrome") Desktop automation, GUI interaction, screen capture
search_videoagent.tool.search_video(query="people discussing AI")Semantic video search using TwelveLabs' Marengo model
chat_videoagent.tool.chat_video(prompt="What are the main topics?", video_id="video_123")Interactive video analysis using TwelveLabs' Pegasus model
mongodb_memoryagent.tool.mongodb_memory(action="record", content="User prefers vegetarian pizza")Store and retrieve memories using MongoDB Atlas with semantic search via AWS Bedrock Titan embeddings (connection and namespace configured via MongoDBMemoryTool or environment variables)
elasticsearch_memoryagent.tool.elasticsearch_memory(action="record", content="User prefers dark mode")Store and retrieve memories using Elasticsearch with semantic search via AWS Bedrock Titan embeddings (connection and namespace configured via ElasticsearchMemoryTool or environment variables)

* These tools do not work on Windows

Deprecations

The tools below are deprecated, and each row points to where that capability now lives.

When this package started, the SDK had no built-in way to do most of these things, so we shipped tools to fill the gap. Much of that is now native: the SDK reasons, injects context, manages memory, and runs tools concurrently on its own, and where a vendor maintains an official MCP server, that server will always track their API better than a wrapper here can. Keeping a second implementation alongside means two things to fix and two things to drift, so we would rather point you at the one that gets the attention.

More tools will follow as their capabilities land elsewhere, and this repository will eventually be archived. Nothing breaks suddenly — but migrating when a tool is first deprecated is easier than moving several at once later.

Deprecated tools keep working. Each one logs a warning when invoked starting in v0.8.6, and that warning becomes an error log in v0.9.0 — a louder signal for anyone who has not migrated, not a behavior change.

They are also marked with @typing_extensions.deprecated, so type checkers and IDEs flag usage before you run anything. To list what you still need to migrate, run mypy --enable-error-code deprecated over your project: it reports the from strands_tools import ... line for each deprecated tool, without invoking any of them. Prefer mypy here: pyright, with reportDeprecated enabled, reports direct calls such as calculator(expression=...) but not agent.tool.calculator(...), and it reaches the import line for only the three tools whose marker is not wrapped by @tool. Note that Python suppresses the resulting DeprecationWarning at runtime when the agent invokes a tool, which is why the log message exists as well.

ToolSuggested alternativeWarningError log
sleepfrom strands.vended_tools import sleepv0.8.6v0.9.0
editorfrom strands.vended_tools import file_editorv0.8.6v0.9.0
shellfrom strands.vended_tools import bashv0.8.6v0.9.0
batchnone needed — concurrent tool execution is the SDK default (docs)v0.8.6v0.9.0
thinknative extended thinking via model reasoning config (docs)v0.8.6v0.9.0
current_timeContextInjector (docs)v0.8.6v0.9.0
memoryMemoryManager + BedrockKnowledgeBaseStore (docs)v0.8.6v0.9.0
retrieveMemoryManager + BedrockKnowledgeBaseStore(writable=False) (docs)v0.8.6v0.9.0
calculatorfrom strands.vended_tools import bash (run python3 -c with sympy)v0.8.6v0.9.0
cronfrom strands.vended_tools import bash (manage crontab), or Amazon EventBridge Schedulerv0.8.6v0.9.0
environmentfrom strands.vended_tools import bash (inspect only, see notes)v0.8.6v0.9.0
slackofficial Slack MCP server; slack_bolt for Socket Modev0.8.6v0.9.0
diagramno replacement — have the model write graphviz/mermaid/diagrams code directlyv0.8.6v0.9.0
rssno replacement — parse feeds directly with feedparserv0.8.6v0.9.0
# BeforefromstrandsimportAgentfromstrands_toolsimporteditor, shell, sleepagent=Agent(tools=[editor, shell, sleep])
# AfterfromstrandsimportAgentfromstrands.vended_toolsimportbash, file_editor, sleepagent=Agent(tools=[bash, file_editor, sleep])

Behavior differences

The replacements are not drop-in equivalents. Check these before migrating:

  • shellbash: the SDK tool routes commands through the agent's configured sandbox and is stateless — each call runs in a fresh shell, so variables and the working directory do not persist between calls. It does not provide PTY support or batched parallel/sequential command execution.
  • editorfile_editor: supports view, create, str_replace, and insert. The pattern_replace, find_line, and undo_edit commands have no SDK equivalent.
  • sleepsleep: the maximum duration is set with make_sleep(max_duration=...) and defaults to 60 seconds, replacing the MAX_SLEEP_SECONDS environment variable which defaulted to 300 seconds.
  • batch — you can drop it. The SDK runs tool calls concurrently by default via ConcurrentToolExecutor, which also keeps tracing, metrics, and hooks intact. See Tool executors.
  • think → extended thinking — reasoning is now a model capability rather than a tool, so you configure it once instead of prompting for it. It is single-pass, so if you were relying on cycle_count to refine across passes, or on tool calls inside the reasoning loop, that pattern moves into your own orchestration. Config is per provider — see Amazon Bedrock.
  • current_timeContextInjector — the date is context, not something the agent should have to ask for, so injecting it means it is always fresh and the model cannot forget to call it. The trade-off is that your code picks the timezone; if you need the model to choose one per call, the official MCP time server still does that. See ContextInjector.
  • memory / retrieve → memory stores — memory is a first-class SDK concept now, so stores plug into the agent and inject context automatically instead of waiting to be called. store/retrieve become add/search. list, get, and delete are not part of the store protocol, so keep them as backend-native tools via get_tools(). One thing to know: the store returns relevance scores but does not filter on them, so if you relied on retrieve's default score >= 0.4 floor, apply it yourself. See Bedrock Knowledge Base store and Custom stores.
  • calculatorshell — run python3 -c with sympy for the same symbolic math. Worth being explicit: shell runs whatever it is given, whereas this tool checked expressions against an allowlist first. If you are evaluating untrusted input, put a sandbox behind the shell tool or keep your own validation in front of it.
  • cronshellcrontab through the shell tool covers scheduling on a host. Two things to plan for: the shell is sandbox-routed, so under Docker or SSH your jobs land in an environment that may not have a cron daemon, and you will be composing crontab lines yourself rather than using structured list/add/remove/edit actions. For scheduling that outlives the host, Amazon EventBridge Scheduler is usually the better fit.
  • environmentshellenv and printenv cover reading. Setting is genuinely different: a child shell cannot change the agent's own process environment, so variables need to be set where the agent is launched, or passed per call. If you were leaning on PROTECTED_VARS or secret masking, that guarding moves to your side.
  • slack → Slack's official MCP server — Slack maintains it, so it tracks their API directly, and it uses OAuth rather than long-lived tokens. It exposes a curated tool set rather than this tool's passthrough to any Web API method, and being request/response it does not cover Socket Mode or real-time events — slack_bolt remains the right tool for event listeners. Endpoint and setup: docs.slack.dev/ai/mcp-server.
  • diagram — no direct replacement, and that is deliberate: this tool was a wrapper over graphviz and the diagrams package, and a capable model writes that code well on its own. The wrapper mostly added a layer to keep in sync.
  • rss — no direct replacement. Fetching and parsing a feed is a few lines of feedparser, and the subscription list was a JSON file. If you were using feed HTTP Basic auth or the stored subscriptions, those move into your code.

💻 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")

Dynamic MCP Client Integration

⚠️SECURITY WARNING: The Dynamic MCP Client allows agents to autonomously connect to external MCP servers and load remote tools at runtime. This poses significant security risks as agents can potentially connect to malicious servers and execute untrusted code. Use with extreme caution in production environments.

This tool is different from the static MCP server implementation in the Strands SDK (see MCP Tools Documentation) which uses pre-configured, trusted MCP servers.

fromstrandsimportAgentfromstrands_toolsimportmcp_clientagent=Agent(tools=[mcp_client])
# Connect to a custom MCP server via stdioagent.tool.mcp_client(
action="connect",
connection_id="my_tools",
transport="stdio",
command="python",
args=["my_mcp_server.py"]
)
# List available tools on the servertools=agent.tool.mcp_client(
action="list_tools",
connection_id="my_tools"
)
# Call a tool from the MCP serverresult=agent.tool.mcp_client(
action="call_tool",
connection_id="my_tools",
tool_name="calculate",
tool_args={"x": 10, "y": 20}
)
# Connect to a SSE-based serveragent.tool.mcp_client(
action="connect",
connection_id="web_server",
transport="sse",
server_url="http://localhost:8080/sse"
)
# Connect to a streamable HTTP serveragent.tool.mcp_client(
action="connect",
connection_id="http_server",
transport="streamable_http",
server_url="https://api.example.com/mcp",
headers={"Authorization": "Bearer token"},
timeout=60
)
# Load MCP tools into agent's registry for direct access# ⚠️ WARNING: This loads external tools directly into the agentagent.tool.mcp_client(
action="load_tools",
connection_id="my_tools"
)
# Now you can call MCP tools directly as: agent.tool.calculate(x=10, y=20)

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
)

Tavily Search, Extract, Crawl, and Map

fromstrandsimportAgentfromstrands_tools.tavilyimport (
tavily_search, tavily_extract, tavily_crawl, tavily_map
)
# For async usage, call the corresponding *_async function with await.# Synchronous usage agent=Agent(tools=[tavily_search, tavily_extract, tavily_crawl, tavily_map])
# Real-time web searchresult=agent.tool.tavily_search(
query="Latest developments in renewable energy",
search_depth="advanced",
topic="news",
max_results=10,
include_raw_content=True
)
# Extract content from multiple URLsresult=agent.tool.tavily_extract(
urls=["www.tavily.com", "www.apple.com"],
extract_depth="advanced",
format="markdown"
)
# Advanced crawl with instructions and filteringresult=agent.tool.tavily_crawl(
url="www.tavily.com",
max_depth=2,
limit=50,
instructions="Find all API documentation and developer guides",
extract_depth="advanced",
include_images=True
)
# Basic website mappingresult=agent.tool.tavily_map(url="www.tavily.com")

Exa Search and Contents

fromstrandsimportAgentfromstrands_tools.exaimportexa_search, exa_get_contentsagent=Agent(tools=[exa_search, exa_get_contents])
# Basic search (auto mode is default and recommended)result=agent.tool.exa_search(
query="Best project management software",
text=True
)
# Company-specific search when neededresult=agent.tool.exa_search(
query="Anthropic AI safety research",
category="company",
include_domains=["anthropic.com"],
num_results=5,
summary={"query": "key research areas and findings"}
)
# News search with date filteringresult=agent.tool.exa_search(
query="AI regulation policy updates",
category="news",
start_published_date="2024-01-01T00:00:00.000Z",
text=True
)
# Get detailed content from specific URLsresult=agent.tool.exa_get_contents(
urls=[
"https://example.com/blog-post",
"https://github.com/microsoft/semantic-kernel"
],
text={"maxCharacters": 5000, "includeHtmlTags": False},
summary={
"query": "main points and practical applications"
},
subpages=2,
extras={"links": 5, "imageLinks": 2}
)
# Structured summary with JSON schemaresult=agent.tool.exa_get_contents(
urls=["https://example.com/article"],
summary={
"query": "main findings and recommendations",
"schema": {
"type": "object",
"properties": {
"main_points": {"type": "string", "description": "Key points from the article"},
"recommendations": {"type": "string", "description": "Suggested actions or advice"},
"conclusion": {"type": "string", "description": "Overall conclusion"},
"relevance": {"type": "string", "description": "Why this matters"}
},
"required": ["main_points", "conclusion"]
}
}
)

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()""")

Code Interpreter

fromstrandsimportAgentfromstrands_tools.code_interpreterimportAgentCoreCodeInterpreter# Create the code interpreter toolbedrock_agent_core_code_interpreter=AgentCoreCodeInterpreter(region="us-west-2")
agent=Agent(tools=[bedrock_agent_core_code_interpreter.code_interpreter])
# Create a sessionagent.tool.code_interpreter({
"action": {
"type": "initSession",
"description": "Data analysis session",
"session_name": "analysis-session"
}
})
# Execute Python codeagent.tool.code_interpreter({
"action": {
"type": "executeCode",
"session_name": "analysis-session",
"code": "print('Hello from sandbox!')",
"language": "python"
}
})

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"
)

Retrieve Tool

fromstrandsimportAgentfromstrands_toolsimportretrieveagent=Agent(tools=[retrieve])
# Basic retrieval without metadataresult=agent.tool.retrieve(
text="What is artificial intelligence?"
)
# Retrieval with metadata enabledresult=agent.tool.retrieve(
text="What are the latest developments in machine learning?",
enableMetadata=True
)
# Using environment variable to set default metadata behavior# Set RETRIEVE_ENABLE_METADATA_DEFAULT=true in your environmentresult=agent.tool.retrieve(
text="Tell me about cloud computing"# enableMetadata will default to the environment variable value
)

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"
}
},
]
)

Video Tools

fromstrandsimportAgentfromstrands_toolsimportsearch_video, chat_videoagent=Agent(tools=[search_video, chat_video])
# Search for video content using natural languageresult=agent.tool.search_video(
query="people discussing AI technology",
threshold="high",
group_by="video",
page_limit=5
)
# Chat with existing video (no index_id needed)result=agent.tool.chat_video(
prompt="What are the main topics discussed in this video?",
video_id="existing-video-id"
)
# Chat with new video file (index_id required for upload)result=agent.tool.chat_video(
prompt="Describe what happens in this video",
video_path="/path/to/video.mp4",
index_id="your-index-id"# or set TWELVELABS_PEGASUS_INDEX_ID env var
)

AgentCore Memory

fromstrandsimportAgentfromstrands_tools.agent_core_memoryimportAgentCoreMemoryToolProviderprovider=AgentCoreMemoryToolProvider(
memory_id="memory-123abc", # Requiredactor_id="user-456", # Requiredsession_id="session-789", # Requirednamespace="default", # Requiredregion="us-west-2"# Optional, defaults to us-west-2
)
agent=Agent(tools=provider.tools)
# Create a new memoryresult=agent.tool.agent_core_memory(
action="record",
content="I am allergic to shellfish"
)
# Search for relevant memoriesresult=agent.tool.agent_core_memory(
action="retrieve",
query="user preferences"
)
# List all memoriesresult=agent.tool.agent_core_memory(
action="list"
)
# Get a specific memory by IDresult=agent.tool.agent_core_memory(
action="get",
memory_record_id="mr-12345"
)

Browser

fromstrandsimportAgentfromstrands_tools.browserimportLocalChromiumBrowser# Create browser toolbrowser=LocalChromiumBrowser()
agent=Agent(tools=[browser.browser])
# Simple navigationresult=agent.tool.browser({
"action": {
"type": "navigate",
"url": "https://example.com"
}
})
# Initialize a session firstresult=agent.tool.browser({
"action": {
"type": "initSession",
"session_name": "main-session",
"description": "Web automation session"
}
})

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
)

Use Agent (Agent as Tool)

fromstrandsimportAgentfromstrands_toolsimportuse_agentagent=Agent(tools=[use_agent])
# Basic usage - inherits parent agent's modelresult=agent.tool.use_agent(
prompt="Tell me about the advantages of tool-building in AI agents",
system_prompt="You are a helpful AI assistant specializing in AI development concepts."
)
# Use a different model provider for specialized tasksresult=agent.tool.use_agent(
prompt="Calculate 2 + 2 and explain the result",
system_prompt="You are a helpful math assistant.",
model_provider="bedrock",
model_settings={
"model_id": "us.anthropic.claude-sonnet-4-20250514-v1:0"
},
tools=["calculator"]
)
# Use environment variables to determine modelimportosos.environ["STRANDS_PROVIDER"] ="ollama"os.environ["STRANDS_MODEL_ID"] ="qwen3:4b"result=agent.tool.use_agent(
prompt="Analyze this code",
system_prompt="You are a code review assistant.",
model_provider="env"
)
# Custom model configuration with specific parametersresult=agent.tool.use_agent(
prompt="Write a creative story",
system_prompt="You are a creative writing assistant.",
model_provider="github",
model_settings={
"model_id": "openai/o4-mini",
"params": {"temperature": 1, "max_tokens": 4000}
}
)

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

Diagram

fromstrandsimportAgentfromstrands_toolsimportdiagramagent=Agent(tools=[diagram])
# Create an AWS cloud architecture diagramresult=agent.tool.diagram(
diagram_type="cloud",
nodes=[
{"id": "users", "type": "Users", "label": "End Users"},
{"id": "cloudfront", "type": "CloudFront", "label": "CDN"},
{"id": "s3", "type": "S3", "label": "Static Assets"},
{"id": "api", "type": "APIGateway", "label": "API Gateway"},
{"id": "lambda", "type": "Lambda", "label": "Backend Service"}
],
edges=[
{"from": "users", "to": "cloudfront"},
{"from": "cloudfront", "to": "s3"},
{"from": "users", "to": "api"},
{"from": "api", "to": "lambda"}
],
title="Web Application Architecture"
)
# Create a UML class diagramresult=agent.tool.diagram(
diagram_type="class",
elements=[
{
"name": "User",
"attributes": ["+id: int", "-name: string", "#email: string"],
"methods": ["+login(): bool", "+logout(): void"]
},
{
"name": "Order",
"attributes": ["+id: int", "-items: List", "-total: float"],
"methods": ["+addItem(item): void", "+calculateTotal(): float"]
}
],
relationships=[
{"from": "User", "to": "Order", "type": "association", "multiplicity": "1..*"}
],
title="E-commerce Domain Model"
)

RSS Feed Management

fromstrandsimportAgentfromstrands_toolsimportrssagent=Agent(tools=[rss])
# Subscribe to a feedresult=agent.tool.rss(
action="subscribe",
url="https://news.example.com/rss/technology"
)
# List all subscribed feedsfeeds=agent.tool.rss(action="list")
# Read entries from a specific feedentries=agent.tool.rss(
action="read",
feed_id="news_example_com_technology",
max_entries=5,
include_content=True
)
# Search across all feedssearch_results=agent.tool.rss(
action="search",
query="machine learning",
max_entries=10
)
# Fetch feed content without subscribinglatest_news=agent.tool.rss(
action="fetch",
url="https://blog.example.org/feed",
max_entries=3
)

Use Computer

fromstrandsimportAgentfromstrands_toolsimportuse_computeragent=Agent(tools=[use_computer])
# Find mouse positionresult=agent.tool.use_computer(action="mouse_position")
# Automate adding textresult=agent.tool.use_computer(action="type", text="Hello, world!", app_name="Notepad")
# Analyze current computer screenresult=agent.tool.use_computer(action="analyze_screen")
result=agent.tool.use_computer(action="open_app", app_name="Calculator")
result=agent.tool.use_computer(action="close_app", app_name="Calendar")
result=agent.tool.use_computer(
action="hotkey",
hotkey_str="command+ctrl+f", # For macOSapp_name="Chrome"
)

Graph (Multi-Agent DAG)

Create deterministic DAG-based multi-agent pipelines where agents are nodes with dependency relationships. Unlike agent_graph (which uses persistent message-passing), graph uses task-based execution with output propagation.

fromstrandsimportAgentfromstrands_tools.graphimportgraphagent=Agent(tools=[graph])
# Create a multi-agent research pipelineresult=agent.tool.graph(
action="create",
graph_id="research_pipeline",
topology={
"nodes": [
{
"id": "researcher",
"role": "researcher",
"system_prompt": "You research topics thoroughly.",
"model_provider": "bedrock",
"model_settings": {"model_id": "us.anthropic.claude-sonnet-4-20250514-v1:0"}
},
{
"id": "analyst",
"role": "analyst",
"system_prompt": "You analyze research data.",
"model_provider": "bedrock",
"model_settings": {"model_id": "us.anthropic.claude-3-5-haiku-20241022-v1:0"}
},
{
"id": "reporter",
"role": "reporter",
"system_prompt": "You create comprehensive reports.",
"tools": ["file_write", "editor"]
}
],
"edges": [
{"from": "researcher", "to": "analyst"},
{"from": "analyst", "to": "reporter"}
],
"entry_points": ["researcher"]
}
)
# Execute a task through the graphresult=agent.tool.graph(
action="execute",
graph_id="research_pipeline",
task="Research and analyze the impact of AI on healthcare"
)
# Get graph statusresult=agent.tool.graph(action="status", graph_id="research_pipeline")
# List all graphsresult=agent.tool.graph(action="list")
# Delete a graphresult=agent.tool.graph(action="delete", graph_id="research_pipeline")

Elasticsearch Memory

Note: This tool requires AWS account credentials to generate embeddings using Amazon Bedrock Titan models.

fromstrandsimportAgentfromstrands_tools.elasticsearch_memoryimportElasticsearchMemoryTool, elasticsearch_memory# Bind connection, index, and namespace per principal (kept out of the agent-facing tool)memory_tool=ElasticsearchMemoryTool(
cloud_id="your-elasticsearch-cloud-id", # or es_url="https://...:443" for Serverlessapi_key="your-api-key",
index_name="memories",
namespace="user_123",
)
agent=Agent(tools=[memory_tool.elasticsearch_memory])
# Store a memory with semantic embeddingsresult=agent.tool.elasticsearch_memory(
action="record",
content="User prefers vegetarian pizza with extra cheese",
metadata={"category": "food_preferences", "type": "dietary"},
)
# Search memories using semantic similarity (vector search)result=agent.tool.elasticsearch_memory(
action="retrieve",
query="food preferences and dietary restrictions",
max_results=5,
)
# List all memories with paginationresult=agent.tool.elasticsearch_memory(action="list", max_results=10)
# Get specific memory by IDresult=agent.tool.elasticsearch_memory(action="get", memory_id="mem_1234567890_abcd1234")
# Delete a memoryresult=agent.tool.elasticsearch_memory(action="delete", memory_id="mem_1234567890_abcd1234")
# Single-tenant: use the standalone tool with configuration from environment variablesagent=Agent(tools=[elasticsearch_memory])
result=agent.tool.elasticsearch_memory(action="record", content="User prefers vegetarian pizza")

MongoDB Atlas Memory

Note: This tool requires AWS account credentials to generate embeddings using Amazon Bedrock Titan models.

fromstrandsimportAgentfromstrands_tools.mongodb_memoryimportMongoDBMemoryTool, mongodb_memory# Bind connection, collection, and namespace per principal (kept out of the agent-facing tool)memory_tool=MongoDBMemoryTool(
cluster_uri="mongodb+srv://username:password@cluster0.mongodb.net/?retryWrites=true&w=majority",
database_name="memories",
collection_name="user_memories",
namespace="user_123",
)
agent=Agent(tools=[memory_tool.mongodb_memory])
# Store a memory with semantic embeddingsresult=agent.tool.mongodb_memory(
action="record",
content="User prefers vegetarian pizza with extra cheese",
metadata={"category": "food_preferences", "type": "dietary"},
)
# Search memories using semantic similarity (vector search)result=agent.tool.mongodb_memory(
action="retrieve",
query="food preferences and dietary restrictions",
max_results=5,
)
# List all memories with paginationresult=agent.tool.mongodb_memory(action="list", max_results=10)
# Get specific memory by IDresult=agent.tool.mongodb_memory(action="get", memory_id="mem_1234567890_abcd1234")
# Delete a memoryresult=agent.tool.mongodb_memory(action="delete", memory_id="mem_1234567890_abcd1234")
# Single-tenant: use the standalone tool with configuration from environment variablesagent=Agent(tools=[mongodb_memory])
result=agent.tool.mongodb_memory(action="record", content="User prefers vegetarian pizza")

🌍 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_NON_INTERACTIVERun tools without interactive prompts, set to "true" to suppress confirmation dialogsfalseTools with a confirmation prompt (e.g. shell, 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

Tavily Search, Extract, Crawl, and Map Tools

Environment VariableDescriptionDefault
TAVILY_API_KEYTavily API key (required for all Tavily functionality)None

Exa Search and Contents Tools

Environment VariableDescriptionDefault
EXA_API_KEYExa API key (required for all Exa functionality)None

Mem0 Memory Tool

Security Model: The tenant-isolation keys (user_id / agent_id) are never exposed as agent-facing tool parameters. The agent only chooses the action and its content/query/memory_id. This prevents a model (or prompt-injected content) from reading, writing, or deleting another tenant's memories.

Usage patterns:

fromstrandsimportAgentfromstrands_tools.mem0_memoryimportMem0MemoryTool, mem0_memory# Multi-tenant (recommended): bind identity per authenticated principaltool=Mem0MemoryTool(user_id=f"user_{authenticated_user_id}")
agent=Agent(tools=[tool.mem0_memory])
agent.tool.mem0_memory(action="store", content="User prefers vegetarian pizza")
# Single-tenant: use the standalone function with env vars (MEM0_USER_ID / MEM0_AGENT_ID)agent=Agent(tools=[mem0_memory])
agent.tool.mem0_memory(action="store", content="User prefers vegetarian pizza")

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
  4. Neptune Analytics (Optional Graph backend for search enhancement):

    • Uses Neptune Analytics as the graph store backend to enhance memory recall.
    • Requires AWS credentials and Neptune Analytics configuration
    # Configure your Neptune Analytics graph ID in the .env file:
    export NEPTUNE_ANALYTICS_GRAPH_IDENTIFIER=sample-graph-id
    # Configure your Neptune Analytics graph ID in Python code:
    import os
    os.environ['NEPTUNE_ANALYTICS_GRAPH_IDENTIFIER'] = "g-sample-graph-id"
    
Environment VariableDescriptionDefaultRequired For
MEM0_USER_IDUser ID for memory operations (standalone function)NoneStandalone
MEM0_AGENT_IDAgent ID for memory operations (standalone function)NoneStandalone
MEM0_API_KEYMem0 Platform API keyNoneMem0 Platform
OPENSEARCH_HOSTOpenSearch Host URLNoneOpenSearch
AWS_REGIONAWS Region for OpenSearchus-west-2OpenSearch
NEPTUNE_ANALYTICS_GRAPH_IDENTIFIERNeptune Analytics Graph IdentifierNoneNeptune Analytics
DEVEnable development mode (bypasses confirmations)falseAll modes
MEM0_LLM_PROVIDERLLM provider for memory processingaws_bedrockAll modes
MEM0_LLM_MODELLLM model for memory processinganthropic.claude-3-5-haiku-20241022-v1:0All modes
MEM0_LLM_TEMPERATURELLM temperature (0.0-2.0)0.1All modes
MEM0_LLM_MAX_TOKENSLLM maximum tokens2000All modes
MEM0_EMBEDDER_PROVIDEREmbedder provider for vector embeddingsaws_bedrockAll modes
MEM0_EMBEDDER_MODELEmbedder model for vector embeddingsamazon.titan-embed-text-v2:0All 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)
  • If NEPTUNE_ANALYTICS_GRAPH_IDENTIFIER is set, the tool will configure Neptune Analytics as graph store to enhance memory search
  • LLM configuration applies to all backend modes and allows customization of the language model used for memory processing

Bright Data Tool

Environment VariableDescriptionDefault
BRIGHTDATA_API_KEYBright Data API KeyNone
BRIGHTDATA_ZONEBright Data Web Unlocker Zoneweb_unlocker1

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
PYTHON_REPL_INTERACTIVEWhether to enable interactive PTY modeNone
PYTHON_REPL_RESET_STATEWhether to reset the REPL state before executionNone
PYTHON_REPL_PERSISTENCE_DIRSet Directory for python_repl tool to write state fileNone

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
EDITOR_DISABLE_BACKUPSkip creating .bak backup files during edit operationsfalse

Environment Tool

Environment VariableDescriptionDefault
ENV_VARS_MASKED_DEFAULTMasking of values whose name contains TOKEN, SECRET, PASSWORD, KEY, or AUTH. Set to false to disable. This is the only way to configure masking: the agent cannot override it through tool input, and the environment tool cannot set it. Tools that execute arbitrary code in the agent process, such as python_repl and shell, can still write ittrue

HTTP Request Tool

Environment VariableDescriptionDefault
STRANDS_HTTP_ALLOW_INSECURE_SSLAllow disabling SSL certificate verification via verify_ssl parameterfalse

Dynamic MCP Client Tool

Environment VariableDescriptionDefault
STRANDS_MCP_TIMEOUTDefault timeout in seconds for MCP operations30.0

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

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

RSS Tool

Environment VariableDescriptionDefault
STRANDS_RSS_MAX_ENTRIESDefault setting for maximum number of entries per feed100
STRANDS_RSS_UPDATE_INTERVALDefault amount of time between updating rss feeds in minutes60
STRANDS_RSS_STORAGE_PATHDefault storage path where rss feeds are stored locallystrands_rss_feeds (this may vary based on your system)

Retrieve Tool

Environment VariableDescriptionDefault
RETRIEVE_ENABLE_METADATA_DEFAULTDefault setting for enabling metadata in retrieve tool responsesfalse

Use Agent Tool

Environment VariableDescriptionDefault
STRANDS_PROVIDERDefault model provider when using model_provider="env"ollama
STRANDS_MODEL_IDDefault model identifier for environment-based model selectionNone
STRANDS_MAX_TOKENSMaximum tokens for the nested agent modelNone
STRANDS_TEMPERATURESampling temperature for the nested agent modelNone

Elasticsearch Memory Tool

Environment VariableDescriptionDefault
ELASTICSEARCH_CLOUD_IDElasticsearch Cloud ID for connectionNone
ELASTICSEARCH_URLElasticsearch URL for serverless connectionNone
ELASTICSEARCH_API_KEYElasticsearch API key for authenticationNone
ELASTICSEARCH_INDEX_NAMEElasticsearch index name for memory storagestrands_memory
ELASTICSEARCH_NAMESPACENamespace for memory isolationdefault
ELASTICSEARCH_EMBEDDING_MODELAmazon Bedrock model for embeddingsamazon.titan-embed-text-v2:0
AWS_REGIONAWS region for Bedrock embedding serviceus-west-2

Note: This tool requires AWS account credentials to generate embeddings using Amazon Bedrock Titan models.

Graph Tool

The graph tool uses the same model provider environment variables as use_agent for per-node model configuration. No additional environment variables are required.

Video Tools

Environment VariableDescriptionDefault
TWELVELABS_API_KEYTwelveLabs API key for video analysisNone
TWELVELABS_MARENGO_INDEX_IDDefault index ID for search_video toolNone
TWELVELABS_PEGASUS_INDEX_IDDefault index ID for chat_video toolNone

MongoDB Atlas Memory Tool

Environment VariableDescriptionDefault
MONGODB_ATLAS_CLUSTER_URIMongoDB Atlas connection stringNone
MONGODB_DATABASE_NAMEDatabase name for MongoDB operationsstrands_memory
MONGODB_COLLECTION_NAMECollection name for MongoDB operationsmemories
MONGODB_NAMESPACENamespace for memory isolationdefault
MONGODB_EMBEDDING_MODELAmazon Bedrock model for embeddingsamazon.titan-embed-text-v2:0

Note: This tool requires AWS account credentials to generate embeddings using Amazon Bedrock Titan models.

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!

Stay in touch with the team

Come meet the Strands team and other users on Discord

License

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

Security

The tools in this repository are experimental and are provided as-is. Any production use should be preceded by an independent security review of the specific tools you enable.

For guidance on building and deploying agents safely, see Responsible AI in the Strands Agents documentation.

To report a security issue, 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 versionsStrands Discord

DocumentationSamplesPython SDKToolsAgent BuilderMCP Server

Strands Agents Tools is a community-driven project that 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, Amazon Bedrock Knowledge Bases, Elasticsearch, and MongoDB Atlas
  • 🕸️ Web Infrastructure - Perform web searches, extract page content, and crawl websites with Tavily and Exa-powered tools
  • 🌐 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
  • 🤖 Agent as Tool - Create nested agent instances with model switching support for multi-model workflows and specialized sub-tasks
  • 🔗 Multi-Agent Graph - Create and manage deterministic DAG-based multi-agent pipelines with output propagation and per-node model configuration
  • 🔌 Dynamic MCP Client - ⚠️ Dynamically connect to external MCP servers and load remote tools (use with caution - see security warnings)
  • 🔄 Multiple Tools per Turn - Call several other tools from one model response with Batch Tool
  • 🔍 Browser Tool - Tool giving an agent access to perform automated actions on a browser (chromium)
  • 📈 Diagram - Create AWS cloud diagrams, basic diagrams, or UML diagrams using python libraries
  • 📰 RSS Feed Manager - Subscribe, fetch, and process RSS feeds with content filtering and persistent storage
  • 🖱️ Computer Tool - Automate desktop actions including mouse movements, keyboard input, screenshots, and application management

Important

The tools in this repository are experimental. Many of them grant agents powerful capabilities — executing code, accessing the file system, calling AWS APIs, connecting to external servers, and automating browsers and desktops — which carry real security implications. Any production use should be preceded by your own independent security review; see the Responsible AI guidance for best practices. Use of these tools is at your own risk.

📦 Installation

Quick Install

pip install strands-agents-tools

To install the dependencies for optional tools:

pip install "strands-agents-tools[mem0_memory, use_browser, rss, use_computer]"

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
editor ⚠️agent.tool.editor(command="view", path="path/to/file.py")Advanced file operations like syntax highlighting, pattern replacement, and multi-file edits
Deprecated — see Deprecations
shell* ⚠️agent.tool.shell(command="ls -la")Executing shell commands, interacting with the operating system, running scripts
Deprecated — see Deprecations
http_requestagent.tool.http_request(method="GET", url="https://api.example.com/data")Making API calls, fetching web data, sending data to external services
tavily_searchagent.tool.tavily_search(query="What is artificial intelligence?", search_depth="advanced")Real-time web search optimized for AI agents with a variety of custom parameters
tavily_extractagent.tool.tavily_extract(urls=["www.tavily.com"], extract_depth="advanced")Extract clean, structured content from web pages with advanced processing and noise removal
tavily_crawlagent.tool.tavily_crawl(url="www.tavily.com", max_depth=2, instructions="Find API docs")Crawl websites intelligently starting from a base URL with filtering and extraction
tavily_mapagent.tool.tavily_map(url="www.tavily.com", max_depth=2, instructions="Find all pages")Map website structure and discover URLs starting from a base URL without content extraction
exa_searchagent.tool.exa_search(query="Best project management tools", text=True)Intelligent web search with auto mode (default) for optimal results, plus fast and deep search modes
exa_get_contentsagent.tool.exa_get_contents(urls=["https://example.com/article"], text=True, summary={"query": "key points"})Extract full content and summaries from specific URLs with live crawling fallback
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
calculator ⚠️agent.tool.calculator(expression="2 * sin(pi/4) + log(e**2)")Performing mathematical operations, symbolic math, equation solving
Deprecated — see Deprecations
code_interpretercode_interpreter = AgentCoreCodeInterpreter(region="us-west-2"); agent = Agent(tools=[code_interpreter.code_interpreter])Execute code in isolated sandbox environments with multi-language support (Python, JavaScript, TypeScript), persistent sessions, and file operations
use_awsagent.tool.use_aws(service_name="s3", operation_name="list_buckets", parameters={}, region="us-west-2")Interacting with AWS services, cloud resource management
retrieve ⚠️agent.tool.retrieve(text="What is STRANDS?")Retrieving information from Amazon Bedrock Knowledge Bases with optional metadata
Deprecated — see Deprecations
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
agent_core_memoryagent.tool.agent_core_memory(action="record", content="Hello, I like vegetarian food")Store and retrieve memories with Amazon Bedrock Agent Core Memory service
mem0_memoryagent.tool.mem0_memory(action="store", content="Remember I like to play tennis")Store user and agent memories across agent runs to provide personalized experience (tenant identity configured via Mem0MemoryTool or environment variables)
bright_dataagent.tool.bright_data(action="scrape_as_markdown", url="https://example.com")Web scraping, search queries, screenshot capture, and structured data extraction from websites and different data feeds
memory ⚠️agent.tool.memory(action="retrieve", query="product features")Store, retrieve, list, and manage documents in Amazon Bedrock Knowledge Bases with configurable parameters via environment variables
Deprecated — see Deprecations
environment ⚠️agent.tool.environment(action="list", prefix="AWS_")Managing environment variables, configuration management
Deprecated — see Deprecations
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
think ⚠️agent.tool.think(thought="Complex problem to analyze", cycle_count=3)Advanced reasoning, multi-step thinking processes
Deprecated — see Deprecations
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_time ⚠️agent.tool.current_time(timezone="US/Pacific")Get the current time in ISO 8601 format for a specified timezone
Deprecated — see Deprecations
sleep ⚠️agent.tool.sleep(seconds=5)Pause execution for the specified number of seconds, interruptible with SIGINT (Ctrl+C)
Deprecated — see Deprecations
agent_graphagent.tool.agent_graph(agents=["agent1", "agent2"], connections=[{"from": "agent1", "to": "agent2"}])Create and visualize agent relationship graphs for complex multi-agent systems
graphagent.tool.graph(action="create", graph_id="pipeline", topology={"nodes": [...], "edges": [...]})Create and manage deterministic DAG-based multi-agent graphs using Strands SDK Graph implementation with per-node model configuration
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
Deprecated — see Deprecations
slack ⚠️agent.tool.slack(action="post_message", channel="general", text="Hello team!")Interact with Slack workspace for messaging and monitoring
Deprecated — see Deprecations
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
use_agentagent.tool.use_agent(prompt="Analyze this code", system_prompt="You are a code analyst.", model_provider="bedrock")Create nested agent instances with model switching, multi-model workflows, cost optimization, and specialized sub-tasks
workflowagent.tool.workflow(action="create", name="data_pipeline", steps=[{"tool": "file_read"}, {"tool": "python_repl"}])Define, execute, and manage multi-step automated workflows
mcp_clientagent.tool.mcp_client(action="connect", connection_id="my_server", transport="stdio", command="python", args=["server.py"])⚠️SECURITY WARNING: Dynamically connect to external MCP servers via stdio, sse, or streamable_http, list tools, and call remote tools. This can pose security risks as agents may connect to malicious servers. Use with caution in production.
batch ⚠️agent.tool.batch(invocations=[{"name": "current_time", "arguments": {"timezone": "Europe/London"}}, {"name": "stop", "arguments": {}}])Call multiple other tools from one request.
Deprecated — see Deprecations
browserbrowser = LocalChromiumBrowser(); agent = Agent(tools=[browser.browser])Web scraping, automated testing, form filling, web automation tasks
diagram ⚠️agent.tool.diagram(diagram_type="cloud", nodes=[{"id": "s3", "type": "S3"}], edges=[])Create AWS cloud architecture diagrams, network diagrams, graphs, and UML diagrams (all 14 types)
Deprecated — see Deprecations
rss ⚠️agent.tool.rss(action="subscribe", url="https://example.com/feed.xml", feed_id="tech_news")Manage RSS feeds: subscribe, fetch, read, search, and update content from various sources
Deprecated — see Deprecations
use_computeragent.tool.use_computer(action="click", x=100, y=200, app_name="Chrome") Desktop automation, GUI interaction, screen capture
search_videoagent.tool.search_video(query="people discussing AI")Semantic video search using TwelveLabs' Marengo model
chat_videoagent.tool.chat_video(prompt="What are the main topics?", video_id="video_123")Interactive video analysis using TwelveLabs' Pegasus model
mongodb_memoryagent.tool.mongodb_memory(action="record", content="User prefers vegetarian pizza")Store and retrieve memories using MongoDB Atlas with semantic search via AWS Bedrock Titan embeddings (connection and namespace configured via MongoDBMemoryTool or environment variables)
elasticsearch_memoryagent.tool.elasticsearch_memory(action="record", content="User prefers dark mode")Store and retrieve memories using Elasticsearch with semantic search via AWS Bedrock Titan embeddings (connection and namespace configured via ElasticsearchMemoryTool or environment variables)

* These tools do not work on Windows

Deprecations

The tools below are deprecated, and each row points to where that capability now lives.

When this package started, the SDK had no built-in way to do most of these things, so we shipped tools to fill the gap. Much of that is now native: the SDK reasons, injects context, manages memory, and runs tools concurrently on its own, and where a vendor maintains an official MCP server, that server will always track their API better than a wrapper here can. Keeping a second implementation alongside means two things to fix and two things to drift, so we would rather point you at the one that gets the attention.

More tools will follow as their capabilities land elsewhere, and this repository will eventually be archived. Nothing breaks suddenly — but migrating when a tool is first deprecated is easier than moving several at once later.

Deprecated tools keep working. Each one logs a warning when invoked starting in v0.8.6, and that warning becomes an error log in v0.9.0 — a louder signal for anyone who has not migrated, not a behavior change.

They are also marked with @typing_extensions.deprecated, so type checkers and IDEs flag usage before you run anything. To list what you still need to migrate, run mypy --enable-error-code deprecated over your project: it reports the from strands_tools import ... line for each deprecated tool, without invoking any of them. Prefer mypy here: pyright, with reportDeprecated enabled, reports direct calls such as calculator(expression=...) but not agent.tool.calculator(...), and it reaches the import line for only the three tools whose marker is not wrapped by @tool. Note that Python suppresses the resulting DeprecationWarning at runtime when the agent invokes a tool, which is why the log message exists as well.

ToolSuggested alternativeWarningError log
sleepfrom strands.vended_tools import sleepv0.8.6v0.9.0
editorfrom strands.vended_tools import file_editorv0.8.6v0.9.0
shellfrom strands.vended_tools import bashv0.8.6v0.9.0
batchnone needed — concurrent tool execution is the SDK default (docs)v0.8.6v0.9.0
thinknative extended thinking via model reasoning config (docs)v0.8.6v0.9.0
current_timeContextInjector (docs)v0.8.6v0.9.0
memoryMemoryManager + BedrockKnowledgeBaseStore (docs)v0.8.6v0.9.0
retrieveMemoryManager + BedrockKnowledgeBaseStore(writable=False) (docs)v0.8.6v0.9.0
calculatorfrom strands.vended_tools import bash (run python3 -c with sympy)v0.8.6v0.9.0
cronfrom strands.vended_tools import bash (manage crontab), or Amazon EventBridge Schedulerv0.8.6v0.9.0
environmentfrom strands.vended_tools import bash (inspect only, see notes)v0.8.6v0.9.0
slackofficial Slack MCP server; slack_bolt for Socket Modev0.8.6v0.9.0
diagramno replacement — have the model write graphviz/mermaid/diagrams code directlyv0.8.6v0.9.0
rssno replacement — parse feeds directly with feedparserv0.8.6v0.9.0
# BeforefromstrandsimportAgentfromstrands_toolsimporteditor, shell, sleepagent=Agent(tools=[editor, shell, sleep])
# AfterfromstrandsimportAgentfromstrands.vended_toolsimportbash, file_editor, sleepagent=Agent(tools=[bash, file_editor, sleep])

Behavior differences

The replacements are not drop-in equivalents. Check these before migrating:

  • shellbash: the SDK tool routes commands through the agent's configured sandbox and is stateless — each call runs in a fresh shell, so variables and the working directory do not persist between calls. It does not provide PTY support or batched parallel/sequential command execution.
  • editorfile_editor: supports view, create, str_replace, and insert. The pattern_replace, find_line, and undo_edit commands have no SDK equivalent.
  • sleepsleep: the maximum duration is set with make_sleep(max_duration=...) and defaults to 60 seconds, replacing the MAX_SLEEP_SECONDS environment variable which defaulted to 300 seconds.
  • batch — you can drop it. The SDK runs tool calls concurrently by default via ConcurrentToolExecutor, which also keeps tracing, metrics, and hooks intact. See Tool executors.
  • think → extended thinking — reasoning is now a model capability rather than a tool, so you configure it once instead of prompting for it. It is single-pass, so if you were relying on cycle_count to refine across passes, or on tool calls inside the reasoning loop, that pattern moves into your own orchestration. Config is per provider — see Amazon Bedrock.
  • current_timeContextInjector — the date is context, not something the agent should have to ask for, so injecting it means it is always fresh and the model cannot forget to call it. The trade-off is that your code picks the timezone; if you need the model to choose one per call, the official MCP time server still does that. See ContextInjector.
  • memory / retrieve → memory stores — memory is a first-class SDK concept now, so stores plug into the agent and inject context automatically instead of waiting to be called. store/retrieve become add/search. list, get, and delete are not part of the store protocol, so keep them as backend-native tools via get_tools(). One thing to know: the store returns relevance scores but does not filter on them, so if you relied on retrieve's default score >= 0.4 floor, apply it yourself. See Bedrock Knowledge Base store and Custom stores.
  • calculatorshell — run python3 -c with sympy for the same symbolic math. Worth being explicit: shell runs whatever it is given, whereas this tool checked expressions against an allowlist first. If you are evaluating untrusted input, put a sandbox behind the shell tool or keep your own validation in front of it.
  • cronshellcrontab through the shell tool covers scheduling on a host. Two things to plan for: the shell is sandbox-routed, so under Docker or SSH your jobs land in an environment that may not have a cron daemon, and you will be composing crontab lines yourself rather than using structured list/add/remove/edit actions. For scheduling that outlives the host, Amazon EventBridge Scheduler is usually the better fit.
  • environmentshellenv and printenv cover reading. Setting is genuinely different: a child shell cannot change the agent's own process environment, so variables need to be set where the agent is launched, or passed per call. If you were leaning on PROTECTED_VARS or secret masking, that guarding moves to your side.
  • slack → Slack's official MCP server — Slack maintains it, so it tracks their API directly, and it uses OAuth rather than long-lived tokens. It exposes a curated tool set rather than this tool's passthrough to any Web API method, and being request/response it does not cover Socket Mode or real-time events — slack_bolt remains the right tool for event listeners. Endpoint and setup: docs.slack.dev/ai/mcp-server.
  • diagram — no direct replacement, and that is deliberate: this tool was a wrapper over graphviz and the diagrams package, and a capable model writes that code well on its own. The wrapper mostly added a layer to keep in sync.
  • rss — no direct replacement. Fetching and parsing a feed is a few lines of feedparser, and the subscription list was a JSON file. If you were using feed HTTP Basic auth or the stored subscriptions, those move into your code.

💻 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")

Dynamic MCP Client Integration

⚠️SECURITY WARNING: The Dynamic MCP Client allows agents to autonomously connect to external MCP servers and load remote tools at runtime. This poses significant security risks as agents can potentially connect to malicious servers and execute untrusted code. Use with extreme caution in production environments.

This tool is different from the static MCP server implementation in the Strands SDK (see MCP Tools Documentation) which uses pre-configured, trusted MCP servers.

fromstrandsimportAgentfromstrands_toolsimportmcp_clientagent=Agent(tools=[mcp_client])
# Connect to a custom MCP server via stdioagent.tool.mcp_client(
action="connect",
connection_id="my_tools",
transport="stdio",
command="python",
args=["my_mcp_server.py"]
)
# List available tools on the servertools=agent.tool.mcp_client(
action="list_tools",
connection_id="my_tools"
)
# Call a tool from the MCP serverresult=agent.tool.mcp_client(
action="call_tool",
connection_id="my_tools",
tool_name="calculate",
tool_args={"x": 10, "y": 20}
)
# Connect to a SSE-based serveragent.tool.mcp_client(
action="connect",
connection_id="web_server",
transport="sse",
server_url="http://localhost:8080/sse"
)
# Connect to a streamable HTTP serveragent.tool.mcp_client(
action="connect",
connection_id="http_server",
transport="streamable_http",
server_url="https://api.example.com/mcp",
headers={"Authorization": "Bearer token"},
timeout=60
)
# Load MCP tools into agent's registry for direct access# ⚠️ WARNING: This loads external tools directly into the agentagent.tool.mcp_client(
action="load_tools",
connection_id="my_tools"
)
# Now you can call MCP tools directly as: agent.tool.calculate(x=10, y=20)

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
)

Tavily Search, Extract, Crawl, and Map

fromstrandsimportAgentfromstrands_tools.tavilyimport (
tavily_search, tavily_extract, tavily_crawl, tavily_map
)
# For async usage, call the corresponding *_async function with await.# Synchronous usage agent=Agent(tools=[tavily_search, tavily_extract, tavily_crawl, tavily_map])
# Real-time web searchresult=agent.tool.tavily_search(
query="Latest developments in renewable energy",
search_depth="advanced",
topic="news",
max_results=10,
include_raw_content=True
)
# Extract content from multiple URLsresult=agent.tool.tavily_extract(
urls=["www.tavily.com", "www.apple.com"],
extract_depth="advanced",
format="markdown"
)
# Advanced crawl with instructions and filteringresult=agent.tool.tavily_crawl(
url="www.tavily.com",
max_depth=2,
limit=50,
instructions="Find all API documentation and developer guides",
extract_depth="advanced",
include_images=True
)
# Basic website mappingresult=agent.tool.tavily_map(url="www.tavily.com")

Exa Search and Contents

fromstrandsimportAgentfromstrands_tools.exaimportexa_search, exa_get_contentsagent=Agent(tools=[exa_search, exa_get_contents])
# Basic search (auto mode is default and recommended)result=agent.tool.exa_search(
query="Best project management software",
text=True
)
# Company-specific search when neededresult=agent.tool.exa_search(
query="Anthropic AI safety research",
category="company",
include_domains=["anthropic.com"],
num_results=5,
summary={"query": "key research areas and findings"}
)
# News search with date filteringresult=agent.tool.exa_search(
query="AI regulation policy updates",
category="news",
start_published_date="2024-01-01T00:00:00.000Z",
text=True
)
# Get detailed content from specific URLsresult=agent.tool.exa_get_contents(
urls=[
"https://example.com/blog-post",
"https://github.com/microsoft/semantic-kernel"
],
text={"maxCharacters": 5000, "includeHtmlTags": False},
summary={
"query": "main points and practical applications"
},
subpages=2,
extras={"links": 5, "imageLinks": 2}
)
# Structured summary with JSON schemaresult=agent.tool.exa_get_contents(
urls=["https://example.com/article"],
summary={
"query": "main findings and recommendations",
"schema": {
"type": "object",
"properties": {
"main_points": {"type": "string", "description": "Key points from the article"},
"recommendations": {"type": "string", "description": "Suggested actions or advice"},
"conclusion": {"type": "string", "description": "Overall conclusion"},
"relevance": {"type": "string", "description": "Why this matters"}
},
"required": ["main_points", "conclusion"]
}
}
)

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()""")

Code Interpreter

fromstrandsimportAgentfromstrands_tools.code_interpreterimportAgentCoreCodeInterpreter# Create the code interpreter toolbedrock_agent_core_code_interpreter=AgentCoreCodeInterpreter(region="us-west-2")
agent=Agent(tools=[bedrock_agent_core_code_interpreter.code_interpreter])
# Create a sessionagent.tool.code_interpreter({
"action": {
"type": "initSession",
"description": "Data analysis session",
"session_name": "analysis-session"
}
})
# Execute Python codeagent.tool.code_interpreter({
"action": {
"type": "executeCode",
"session_name": "analysis-session",
"code": "print('Hello from sandbox!')",
"language": "python"
}
})

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"
)

Retrieve Tool

fromstrandsimportAgentfromstrands_toolsimportretrieveagent=Agent(tools=[retrieve])
# Basic retrieval without metadataresult=agent.tool.retrieve(
text="What is artificial intelligence?"
)
# Retrieval with metadata enabledresult=agent.tool.retrieve(
text="What are the latest developments in machine learning?",
enableMetadata=True
)
# Using environment variable to set default metadata behavior# Set RETRIEVE_ENABLE_METADATA_DEFAULT=true in your environmentresult=agent.tool.retrieve(
text="Tell me about cloud computing"# enableMetadata will default to the environment variable value
)

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"
}
},
]
)

Video Tools

fromstrandsimportAgentfromstrands_toolsimportsearch_video, chat_videoagent=Agent(tools=[search_video, chat_video])
# Search for video content using natural languageresult=agent.tool.search_video(
query="people discussing AI technology",
threshold="high",
group_by="video",
page_limit=5
)
# Chat with existing video (no index_id needed)result=agent.tool.chat_video(
prompt="What are the main topics discussed in this video?",
video_id="existing-video-id"
)
# Chat with new video file (index_id required for upload)result=agent.tool.chat_video(
prompt="Describe what happens in this video",
video_path="/path/to/video.mp4",
index_id="your-index-id"# or set TWELVELABS_PEGASUS_INDEX_ID env var
)

AgentCore Memory

fromstrandsimportAgentfromstrands_tools.agent_core_memoryimportAgentCoreMemoryToolProviderprovider=AgentCoreMemoryToolProvider(
memory_id="memory-123abc", # Requiredactor_id="user-456", # Requiredsession_id="session-789", # Requirednamespace="default", # Requiredregion="us-west-2"# Optional, defaults to us-west-2
)
agent=Agent(tools=provider.tools)
# Create a new memoryresult=agent.tool.agent_core_memory(
action="record",
content="I am allergic to shellfish"
)
# Search for relevant memoriesresult=agent.tool.agent_core_memory(
action="retrieve",
query="user preferences"
)
# List all memoriesresult=agent.tool.agent_core_memory(
action="list"
)
# Get a specific memory by IDresult=agent.tool.agent_core_memory(
action="get",
memory_record_id="mr-12345"
)

Browser

fromstrandsimportAgentfromstrands_tools.browserimportLocalChromiumBrowser# Create browser toolbrowser=LocalChromiumBrowser()
agent=Agent(tools=[browser.browser])
# Simple navigationresult=agent.tool.browser({
"action": {
"type": "navigate",
"url": "https://example.com"
}
})
# Initialize a session firstresult=agent.tool.browser({
"action": {
"type": "initSession",
"session_name": "main-session",
"description": "Web automation session"
}
})

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
)

Use Agent (Agent as Tool)

fromstrandsimportAgentfromstrands_toolsimportuse_agentagent=Agent(tools=[use_agent])
# Basic usage - inherits parent agent's modelresult=agent.tool.use_agent(
prompt="Tell me about the advantages of tool-building in AI agents",
system_prompt="You are a helpful AI assistant specializing in AI development concepts."
)
# Use a different model provider for specialized tasksresult=agent.tool.use_agent(
prompt="Calculate 2 + 2 and explain the result",
system_prompt="You are a helpful math assistant.",
model_provider="bedrock",
model_settings={
"model_id": "us.anthropic.claude-sonnet-4-20250514-v1:0"
},
tools=["calculator"]
)
# Use environment variables to determine modelimportosos.environ["STRANDS_PROVIDER"] ="ollama"os.environ["STRANDS_MODEL_ID"] ="qwen3:4b"result=agent.tool.use_agent(
prompt="Analyze this code",
system_prompt="You are a code review assistant.",
model_provider="env"
)
# Custom model configuration with specific parametersresult=agent.tool.use_agent(
prompt="Write a creative story",
system_prompt="You are a creative writing assistant.",
model_provider="github",
model_settings={
"model_id": "openai/o4-mini",
"params": {"temperature": 1, "max_tokens": 4000}
}
)

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

Diagram

fromstrandsimportAgentfromstrands_toolsimportdiagramagent=Agent(tools=[diagram])
# Create an AWS cloud architecture diagramresult=agent.tool.diagram(
diagram_type="cloud",
nodes=[
{"id": "users", "type": "Users", "label": "End Users"},
{"id": "cloudfront", "type": "CloudFront", "label": "CDN"},
{"id": "s3", "type": "S3", "label": "Static Assets"},
{"id": "api", "type": "APIGateway", "label": "API Gateway"},
{"id": "lambda", "type": "Lambda", "label": "Backend Service"}
],
edges=[
{"from": "users", "to": "cloudfront"},
{"from": "cloudfront", "to": "s3"},
{"from": "users", "to": "api"},
{"from": "api", "to": "lambda"}
],
title="Web Application Architecture"
)
# Create a UML class diagramresult=agent.tool.diagram(
diagram_type="class",
elements=[
{
"name": "User",
"attributes": ["+id: int", "-name: string", "#email: string"],
"methods": ["+login(): bool", "+logout(): void"]
},
{
"name": "Order",
"attributes": ["+id: int", "-items: List", "-total: float"],
"methods": ["+addItem(item): void", "+calculateTotal(): float"]
}
],
relationships=[
{"from": "User", "to": "Order", "type": "association", "multiplicity": "1..*"}
],
title="E-commerce Domain Model"
)

RSS Feed Management

fromstrandsimportAgentfromstrands_toolsimportrssagent=Agent(tools=[rss])
# Subscribe to a feedresult=agent.tool.rss(
action="subscribe",
url="https://news.example.com/rss/technology"
)
# List all subscribed feedsfeeds=agent.tool.rss(action="list")
# Read entries from a specific feedentries=agent.tool.rss(
action="read",
feed_id="news_example_com_technology",
max_entries=5,
include_content=True
)
# Search across all feedssearch_results=agent.tool.rss(
action="search",
query="machine learning",
max_entries=10
)
# Fetch feed content without subscribinglatest_news=agent.tool.rss(
action="fetch",
url="https://blog.example.org/feed",
max_entries=3
)

Use Computer

fromstrandsimportAgentfromstrands_toolsimportuse_computeragent=Agent(tools=[use_computer])
# Find mouse positionresult=agent.tool.use_computer(action="mouse_position")
# Automate adding textresult=agent.tool.use_computer(action="type", text="Hello, world!", app_name="Notepad")
# Analyze current computer screenresult=agent.tool.use_computer(action="analyze_screen")
result=agent.tool.use_computer(action="open_app", app_name="Calculator")
result=agent.tool.use_computer(action="close_app", app_name="Calendar")
result=agent.tool.use_computer(
action="hotkey",
hotkey_str="command+ctrl+f", # For macOSapp_name="Chrome"
)

Graph (Multi-Agent DAG)

Create deterministic DAG-based multi-agent pipelines where agents are nodes with dependency relationships. Unlike agent_graph (which uses persistent message-passing), graph uses task-based execution with output propagation.

fromstrandsimportAgentfromstrands_tools.graphimportgraphagent=Agent(tools=[graph])
# Create a multi-agent research pipelineresult=agent.tool.graph(
action="create",
graph_id="research_pipeline",
topology={
"nodes": [
{
"id": "researcher",
"role": "researcher",
"system_prompt": "You research topics thoroughly.",
"model_provider": "bedrock",
"model_settings": {"model_id": "us.anthropic.claude-sonnet-4-20250514-v1:0"}
},
{
"id": "analyst",
"role": "analyst",
"system_prompt": "You analyze research data.",
"model_provider": "bedrock",
"model_settings": {"model_id": "us.anthropic.claude-3-5-haiku-20241022-v1:0"}
},
{
"id": "reporter",
"role": "reporter",
"system_prompt": "You create comprehensive reports.",
"tools": ["file_write", "editor"]
}
],
"edges": [
{"from": "researcher", "to": "analyst"},
{"from": "analyst", "to": "reporter"}
],
"entry_points": ["researcher"]
}
)
# Execute a task through the graphresult=agent.tool.graph(
action="execute",
graph_id="research_pipeline",
task="Research and analyze the impact of AI on healthcare"
)
# Get graph statusresult=agent.tool.graph(action="status", graph_id="research_pipeline")
# List all graphsresult=agent.tool.graph(action="list")
# Delete a graphresult=agent.tool.graph(action="delete", graph_id="research_pipeline")

Elasticsearch Memory

Note: This tool requires AWS account credentials to generate embeddings using Amazon Bedrock Titan models.

fromstrandsimportAgentfromstrands_tools.elasticsearch_memoryimportElasticsearchMemoryTool, elasticsearch_memory# Bind connection, index, and namespace per principal (kept out of the agent-facing tool)memory_tool=ElasticsearchMemoryTool(
cloud_id="your-elasticsearch-cloud-id", # or es_url="https://...:443" for Serverlessapi_key="your-api-key",
index_name="memories",
namespace="user_123",
)
agent=Agent(tools=[memory_tool.elasticsearch_memory])
# Store a memory with semantic embeddingsresult=agent.tool.elasticsearch_memory(
action="record",
content="User prefers vegetarian pizza with extra cheese",
metadata={"category": "food_preferences", "type": "dietary"},
)
# Search memories using semantic similarity (vector search)result=agent.tool.elasticsearch_memory(
action="retrieve",
query="food preferences and dietary restrictions",
max_results=5,
)
# List all memories with paginationresult=agent.tool.elasticsearch_memory(action="list", max_results=10)
# Get specific memory by IDresult=agent.tool.elasticsearch_memory(action="get", memory_id="mem_1234567890_abcd1234")
# Delete a memoryresult=agent.tool.elasticsearch_memory(action="delete", memory_id="mem_1234567890_abcd1234")
# Single-tenant: use the standalone tool with configuration from environment variablesagent=Agent(tools=[elasticsearch_memory])
result=agent.tool.elasticsearch_memory(action="record", content="User prefers vegetarian pizza")

MongoDB Atlas Memory

Note: This tool requires AWS account credentials to generate embeddings using Amazon Bedrock Titan models.

fromstrandsimportAgentfromstrands_tools.mongodb_memoryimportMongoDBMemoryTool, mongodb_memory# Bind connection, collection, and namespace per principal (kept out of the agent-facing tool)memory_tool=MongoDBMemoryTool(
cluster_uri="mongodb+srv://username:password@cluster0.mongodb.net/?retryWrites=true&w=majority",
database_name="memories",
collection_name="user_memories",
namespace="user_123",
)
agent=Agent(tools=[memory_tool.mongodb_memory])
# Store a memory with semantic embeddingsresult=agent.tool.mongodb_memory(
action="record",
content="User prefers vegetarian pizza with extra cheese",
metadata={"category": "food_preferences", "type": "dietary"},
)
# Search memories using semantic similarity (vector search)result=agent.tool.mongodb_memory(
action="retrieve",
query="food preferences and dietary restrictions",
max_results=5,
)
# List all memories with paginationresult=agent.tool.mongodb_memory(action="list", max_results=10)
# Get specific memory by IDresult=agent.tool.mongodb_memory(action="get", memory_id="mem_1234567890_abcd1234")
# Delete a memoryresult=agent.tool.mongodb_memory(action="delete", memory_id="mem_1234567890_abcd1234")
# Single-tenant: use the standalone tool with configuration from environment variablesagent=Agent(tools=[mongodb_memory])
result=agent.tool.mongodb_memory(action="record", content="User prefers vegetarian pizza")

🌍 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_NON_INTERACTIVERun tools without interactive prompts, set to "true" to suppress confirmation dialogsfalseTools with a confirmation prompt (e.g. shell, 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

Tavily Search, Extract, Crawl, and Map Tools

Environment VariableDescriptionDefault
TAVILY_API_KEYTavily API key (required for all Tavily functionality)None

Exa Search and Contents Tools

Environment VariableDescriptionDefault
EXA_API_KEYExa API key (required for all Exa functionality)None

Mem0 Memory Tool

Security Model: The tenant-isolation keys (user_id / agent_id) are never exposed as agent-facing tool parameters. The agent only chooses the action and its content/query/memory_id. This prevents a model (or prompt-injected content) from reading, writing, or deleting another tenant's memories.

Usage patterns:

fromstrandsimportAgentfromstrands_tools.mem0_memoryimportMem0MemoryTool, mem0_memory# Multi-tenant (recommended): bind identity per authenticated principaltool=Mem0MemoryTool(user_id=f"user_{authenticated_user_id}")
agent=Agent(tools=[tool.mem0_memory])
agent.tool.mem0_memory(action="store", content="User prefers vegetarian pizza")
# Single-tenant: use the standalone function with env vars (MEM0_USER_ID / MEM0_AGENT_ID)agent=Agent(tools=[mem0_memory])
agent.tool.mem0_memory(action="store", content="User prefers vegetarian pizza")

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
  4. Neptune Analytics (Optional Graph backend for search enhancement):

    • Uses Neptune Analytics as the graph store backend to enhance memory recall.
    • Requires AWS credentials and Neptune Analytics configuration
    # Configure your Neptune Analytics graph ID in the .env file:
    export NEPTUNE_ANALYTICS_GRAPH_IDENTIFIER=sample-graph-id
    # Configure your Neptune Analytics graph ID in Python code:
    import os
    os.environ['NEPTUNE_ANALYTICS_GRAPH_IDENTIFIER'] = "g-sample-graph-id"
    
Environment VariableDescriptionDefaultRequired For
MEM0_USER_IDUser ID for memory operations (standalone function)NoneStandalone
MEM0_AGENT_IDAgent ID for memory operations (standalone function)NoneStandalone
MEM0_API_KEYMem0 Platform API keyNoneMem0 Platform
OPENSEARCH_HOSTOpenSearch Host URLNoneOpenSearch
AWS_REGIONAWS Region for OpenSearchus-west-2OpenSearch
NEPTUNE_ANALYTICS_GRAPH_IDENTIFIERNeptune Analytics Graph IdentifierNoneNeptune Analytics
DEVEnable development mode (bypasses confirmations)falseAll modes
MEM0_LLM_PROVIDERLLM provider for memory processingaws_bedrockAll modes
MEM0_LLM_MODELLLM model for memory processinganthropic.claude-3-5-haiku-20241022-v1:0All modes
MEM0_LLM_TEMPERATURELLM temperature (0.0-2.0)0.1All modes
MEM0_LLM_MAX_TOKENSLLM maximum tokens2000All modes
MEM0_EMBEDDER_PROVIDEREmbedder provider for vector embeddingsaws_bedrockAll modes
MEM0_EMBEDDER_MODELEmbedder model for vector embeddingsamazon.titan-embed-text-v2:0All 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)
  • If NEPTUNE_ANALYTICS_GRAPH_IDENTIFIER is set, the tool will configure Neptune Analytics as graph store to enhance memory search
  • LLM configuration applies to all backend modes and allows customization of the language model used for memory processing

Bright Data Tool

Environment VariableDescriptionDefault
BRIGHTDATA_API_KEYBright Data API KeyNone
BRIGHTDATA_ZONEBright Data Web Unlocker Zoneweb_unlocker1

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
PYTHON_REPL_INTERACTIVEWhether to enable interactive PTY modeNone
PYTHON_REPL_RESET_STATEWhether to reset the REPL state before executionNone
PYTHON_REPL_PERSISTENCE_DIRSet Directory for python_repl tool to write state fileNone

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
EDITOR_DISABLE_BACKUPSkip creating .bak backup files during edit operationsfalse

Environment Tool

Environment VariableDescriptionDefault
ENV_VARS_MASKED_DEFAULTMasking of values whose name contains TOKEN, SECRET, PASSWORD, KEY, or AUTH. Set to false to disable. This is the only way to configure masking: the agent cannot override it through tool input, and the environment tool cannot set it. Tools that execute arbitrary code in the agent process, such as python_repl and shell, can still write ittrue

HTTP Request Tool

Environment VariableDescriptionDefault
STRANDS_HTTP_ALLOW_INSECURE_SSLAllow disabling SSL certificate verification via verify_ssl parameterfalse

Dynamic MCP Client Tool

Environment VariableDescriptionDefault
STRANDS_MCP_TIMEOUTDefault timeout in seconds for MCP operations30.0

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

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

RSS Tool

Environment VariableDescriptionDefault
STRANDS_RSS_MAX_ENTRIESDefault setting for maximum number of entries per feed100
STRANDS_RSS_UPDATE_INTERVALDefault amount of time between updating rss feeds in minutes60
STRANDS_RSS_STORAGE_PATHDefault storage path where rss feeds are stored locallystrands_rss_feeds (this may vary based on your system)

Retrieve Tool

Environment VariableDescriptionDefault
RETRIEVE_ENABLE_METADATA_DEFAULTDefault setting for enabling metadata in retrieve tool responsesfalse

Use Agent Tool

Environment VariableDescriptionDefault
STRANDS_PROVIDERDefault model provider when using model_provider="env"ollama
STRANDS_MODEL_IDDefault model identifier for environment-based model selectionNone
STRANDS_MAX_TOKENSMaximum tokens for the nested agent modelNone
STRANDS_TEMPERATURESampling temperature for the nested agent modelNone

Elasticsearch Memory Tool

Environment VariableDescriptionDefault
ELASTICSEARCH_CLOUD_IDElasticsearch Cloud ID for connectionNone
ELASTICSEARCH_URLElasticsearch URL for serverless connectionNone
ELASTICSEARCH_API_KEYElasticsearch API key for authenticationNone
ELASTICSEARCH_INDEX_NAMEElasticsearch index name for memory storagestrands_memory
ELASTICSEARCH_NAMESPACENamespace for memory isolationdefault
ELASTICSEARCH_EMBEDDING_MODELAmazon Bedrock model for embeddingsamazon.titan-embed-text-v2:0
AWS_REGIONAWS region for Bedrock embedding serviceus-west-2

Note: This tool requires AWS account credentials to generate embeddings using Amazon Bedrock Titan models.

Graph Tool

The graph tool uses the same model provider environment variables as use_agent for per-node model configuration. No additional environment variables are required.

Video Tools

Environment VariableDescriptionDefault
TWELVELABS_API_KEYTwelveLabs API key for video analysisNone
TWELVELABS_MARENGO_INDEX_IDDefault index ID for search_video toolNone
TWELVELABS_PEGASUS_INDEX_IDDefault index ID for chat_video toolNone

MongoDB Atlas Memory Tool

Environment VariableDescriptionDefault
MONGODB_ATLAS_CLUSTER_URIMongoDB Atlas connection stringNone
MONGODB_DATABASE_NAMEDatabase name for MongoDB operationsstrands_memory
MONGODB_COLLECTION_NAMECollection name for MongoDB operationsmemories
MONGODB_NAMESPACENamespace for memory isolationdefault
MONGODB_EMBEDDING_MODELAmazon Bedrock model for embeddingsamazon.titan-embed-text-v2:0

Note: This tool requires AWS account credentials to generate embeddings using Amazon Bedrock Titan models.

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!

Stay in touch with the team

Come meet the Strands team and other users on Discord

License

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

Security

The tools in this repository are experimental and are provided as-is. Any production use should be preceded by an independent security review of the specific tools you enable.

For guidance on building and deploying agents safely, see Responsible AI in the Strands Agents documentation.

To report a security issue, 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 versionsStrands Discord

DocumentationSamplesPython SDKToolsAgent BuilderMCP Server

Strands Agents Tools is a community-driven project that 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, Amazon Bedrock Knowledge Bases, Elasticsearch, and MongoDB Atlas
  • 🕸️ Web Infrastructure - Perform web searches, extract page content, and crawl websites with Tavily and Exa-powered tools
  • 🌐 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
  • 🤖 Agent as Tool - Create nested agent instances with model switching support for multi-model workflows and specialized sub-tasks
  • 🔗 Multi-Agent Graph - Create and manage deterministic DAG-based multi-agent pipelines with output propagation and per-node model configuration
  • 🔌 Dynamic MCP Client - ⚠️ Dynamically connect to external MCP servers and load remote tools (use with caution - see security warnings)
  • 🔄 Multiple Tools per Turn - Call several other tools from one model response with Batch Tool
  • 🔍 Browser Tool - Tool giving an agent access to perform automated actions on a browser (chromium)
  • 📈 Diagram - Create AWS cloud diagrams, basic diagrams, or UML diagrams using python libraries
  • 📰 RSS Feed Manager - Subscribe, fetch, and process RSS feeds with content filtering and persistent storage
  • 🖱️ Computer Tool - Automate desktop actions including mouse movements, keyboard input, screenshots, and application management

Important

The tools in this repository are experimental. Many of them grant agents powerful capabilities — executing code, accessing the file system, calling AWS APIs, connecting to external servers, and automating browsers and desktops — which carry real security implications. Any production use should be preceded by your own independent security review; see the Responsible AI guidance for best practices. Use of these tools is at your own risk.

📦 Installation

Quick Install

pip install strands-agents-tools

To install the dependencies for optional tools:

pip install "strands-agents-tools[mem0_memory, use_browser, rss, use_computer]"

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
editor ⚠️agent.tool.editor(command="view", path="path/to/file.py")Advanced file operations like syntax highlighting, pattern replacement, and multi-file edits
Deprecated — see Deprecations
shell* ⚠️agent.tool.shell(command="ls -la")Executing shell commands, interacting with the operating system, running scripts
Deprecated — see Deprecations
http_requestagent.tool.http_request(method="GET", url="https://api.example.com/data")Making API calls, fetching web data, sending data to external services
tavily_searchagent.tool.tavily_search(query="What is artificial intelligence?", search_depth="advanced")Real-time web search optimized for AI agents with a variety of custom parameters
tavily_extractagent.tool.tavily_extract(urls=["www.tavily.com"], extract_depth="advanced")Extract clean, structured content from web pages with advanced processing and noise removal
tavily_crawlagent.tool.tavily_crawl(url="www.tavily.com", max_depth=2, instructions="Find API docs")Crawl websites intelligently starting from a base URL with filtering and extraction
tavily_mapagent.tool.tavily_map(url="www.tavily.com", max_depth=2, instructions="Find all pages")Map website structure and discover URLs starting from a base URL without content extraction
exa_searchagent.tool.exa_search(query="Best project management tools", text=True)Intelligent web search with auto mode (default) for optimal results, plus fast and deep search modes
exa_get_contentsagent.tool.exa_get_contents(urls=["https://example.com/article"], text=True, summary={"query": "key points"})Extract full content and summaries from specific URLs with live crawling fallback
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
calculator ⚠️agent.tool.calculator(expression="2 * sin(pi/4) + log(e**2)")Performing mathematical operations, symbolic math, equation solving
Deprecated — see Deprecations
code_interpretercode_interpreter = AgentCoreCodeInterpreter(region="us-west-2"); agent = Agent(tools=[code_interpreter.code_interpreter])Execute code in isolated sandbox environments with multi-language support (Python, JavaScript, TypeScript), persistent sessions, and file operations
use_awsagent.tool.use_aws(service_name="s3", operation_name="list_buckets", parameters={}, region="us-west-2")Interacting with AWS services, cloud resource management
retrieve ⚠️agent.tool.retrieve(text="What is STRANDS?")Retrieving information from Amazon Bedrock Knowledge Bases with optional metadata
Deprecated — see Deprecations
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
agent_core_memoryagent.tool.agent_core_memory(action="record", content="Hello, I like vegetarian food")Store and retrieve memories with Amazon Bedrock Agent Core Memory service
mem0_memoryagent.tool.mem0_memory(action="store", content="Remember I like to play tennis")Store user and agent memories across agent runs to provide personalized experience (tenant identity configured via Mem0MemoryTool or environment variables)
bright_dataagent.tool.bright_data(action="scrape_as_markdown", url="https://example.com")Web scraping, search queries, screenshot capture, and structured data extraction from websites and different data feeds
memory ⚠️agent.tool.memory(action="retrieve", query="product features")Store, retrieve, list, and manage documents in Amazon Bedrock Knowledge Bases with configurable parameters via environment variables
Deprecated — see Deprecations
environment ⚠️agent.tool.environment(action="list", prefix="AWS_")Managing environment variables, configuration management
Deprecated — see Deprecations
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
think ⚠️agent.tool.think(thought="Complex problem to analyze", cycle_count=3)Advanced reasoning, multi-step thinking processes
Deprecated — see Deprecations
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_time ⚠️agent.tool.current_time(timezone="US/Pacific")Get the current time in ISO 8601 format for a specified timezone
Deprecated — see Deprecations
sleep ⚠️agent.tool.sleep(seconds=5)Pause execution for the specified number of seconds, interruptible with SIGINT (Ctrl+C)
Deprecated — see Deprecations
agent_graphagent.tool.agent_graph(agents=["agent1", "agent2"], connections=[{"from": "agent1", "to": "agent2"}])Create and visualize agent relationship graphs for complex multi-agent systems
graphagent.tool.graph(action="create", graph_id="pipeline", topology={"nodes": [...], "edges": [...]})Create and manage deterministic DAG-based multi-agent graphs using Strands SDK Graph implementation with per-node model configuration
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
Deprecated — see Deprecations
slack ⚠️agent.tool.slack(action="post_message", channel="general", text="Hello team!")Interact with Slack workspace for messaging and monitoring
Deprecated — see Deprecations
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
use_agentagent.tool.use_agent(prompt="Analyze this code", system_prompt="You are a code analyst.", model_provider="bedrock")Create nested agent instances with model switching, multi-model workflows, cost optimization, and specialized sub-tasks
workflowagent.tool.workflow(action="create", name="data_pipeline", steps=[{"tool": "file_read"}, {"tool": "python_repl"}])Define, execute, and manage multi-step automated workflows
mcp_clientagent.tool.mcp_client(action="connect", connection_id="my_server", transport="stdio", command="python", args=["server.py"])⚠️SECURITY WARNING: Dynamically connect to external MCP servers via stdio, sse, or streamable_http, list tools, and call remote tools. This can pose security risks as agents may connect to malicious servers. Use with caution in production.
batch ⚠️agent.tool.batch(invocations=[{"name": "current_time", "arguments": {"timezone": "Europe/London"}}, {"name": "stop", "arguments": {}}])Call multiple other tools from one request.
Deprecated — see Deprecations
browserbrowser = LocalChromiumBrowser(); agent = Agent(tools=[browser.browser])Web scraping, automated testing, form filling, web automation tasks
diagram ⚠️agent.tool.diagram(diagram_type="cloud", nodes=[{"id": "s3", "type": "S3"}], edges=[])Create AWS cloud architecture diagrams, network diagrams, graphs, and UML diagrams (all 14 types)
Deprecated — see Deprecations
rss ⚠️agent.tool.rss(action="subscribe", url="https://example.com/feed.xml", feed_id="tech_news")Manage RSS feeds: subscribe, fetch, read, search, and update content from various sources
Deprecated — see Deprecations
use_computeragent.tool.use_computer(action="click", x=100, y=200, app_name="Chrome") Desktop automation, GUI interaction, screen capture
search_videoagent.tool.search_video(query="people discussing AI")Semantic video search using TwelveLabs' Marengo model
chat_videoagent.tool.chat_video(prompt="What are the main topics?", video_id="video_123")Interactive video analysis using TwelveLabs' Pegasus model
mongodb_memoryagent.tool.mongodb_memory(action="record", content="User prefers vegetarian pizza")Store and retrieve memories using MongoDB Atlas with semantic search via AWS Bedrock Titan embeddings (connection and namespace configured via MongoDBMemoryTool or environment variables)
elasticsearch_memoryagent.tool.elasticsearch_memory(action="record", content="User prefers dark mode")Store and retrieve memories using Elasticsearch with semantic search via AWS Bedrock Titan embeddings (connection and namespace configured via ElasticsearchMemoryTool or environment variables)

* These tools do not work on Windows

Deprecations

The tools below are deprecated, and each row points to where that capability now lives.

When this package started, the SDK had no built-in way to do most of these things, so we shipped tools to fill the gap. Much of that is now native: the SDK reasons, injects context, manages memory, and runs tools concurrently on its own, and where a vendor maintains an official MCP server, that server will always track their API better than a wrapper here can. Keeping a second implementation alongside means two things to fix and two things to drift, so we would rather point you at the one that gets the attention.

More tools will follow as their capabilities land elsewhere, and this repository will eventually be archived. Nothing breaks suddenly — but migrating when a tool is first deprecated is easier than moving several at once later.

Deprecated tools keep working. Each one logs a warning when invoked starting in v0.8.6, and that warning becomes an error log in v0.9.0 — a louder signal for anyone who has not migrated, not a behavior change.

They are also marked with @typing_extensions.deprecated, so type checkers and IDEs flag usage before you run anything. To list what you still need to migrate, run mypy --enable-error-code deprecated over your project: it reports the from strands_tools import ... line for each deprecated tool, without invoking any of them. Prefer mypy here: pyright, with reportDeprecated enabled, reports direct calls such as calculator(expression=...) but not agent.tool.calculator(...), and it reaches the import line for only the three tools whose marker is not wrapped by @tool. Note that Python suppresses the resulting DeprecationWarning at runtime when the agent invokes a tool, which is why the log message exists as well.

ToolSuggested alternativeWarningError log
sleepfrom strands.vended_tools import sleepv0.8.6v0.9.0
editorfrom strands.vended_tools import file_editorv0.8.6v0.9.0
shellfrom strands.vended_tools import bashv0.8.6v0.9.0
batchnone needed — concurrent tool execution is the SDK default (docs)v0.8.6v0.9.0
thinknative extended thinking via model reasoning config (docs)v0.8.6v0.9.0
current_timeContextInjector (docs)v0.8.6v0.9.0
memoryMemoryManager + BedrockKnowledgeBaseStore (docs)v0.8.6v0.9.0
retrieveMemoryManager + BedrockKnowledgeBaseStore(writable=False) (docs)v0.8.6v0.9.0
calculatorfrom strands.vended_tools import bash (run python3 -c with sympy)v0.8.6v0.9.0
cronfrom strands.vended_tools import bash (manage crontab), or Amazon EventBridge Schedulerv0.8.6v0.9.0
environmentfrom strands.vended_tools import bash (inspect only, see notes)v0.8.6v0.9.0
slackofficial Slack MCP server; slack_bolt for Socket Modev0.8.6v0.9.0
diagramno replacement — have the model write graphviz/mermaid/diagrams code directlyv0.8.6v0.9.0
rssno replacement — parse feeds directly with feedparserv0.8.6v0.9.0
# BeforefromstrandsimportAgentfromstrands_toolsimporteditor, shell, sleepagent=Agent(tools=[editor, shell, sleep])
# AfterfromstrandsimportAgentfromstrands.vended_toolsimportbash, file_editor, sleepagent=Agent(tools=[bash, file_editor, sleep])

Behavior differences

The replacements are not drop-in equivalents. Check these before migrating:

  • shellbash: the SDK tool routes commands through the agent's configured sandbox and is stateless — each call runs in a fresh shell, so variables and the working directory do not persist between calls. It does not provide PTY support or batched parallel/sequential command execution.
  • editorfile_editor: supports view, create, str_replace, and insert. The pattern_replace, find_line, and undo_edit commands have no SDK equivalent.
  • sleepsleep: the maximum duration is set with make_sleep(max_duration=...) and defaults to 60 seconds, replacing the MAX_SLEEP_SECONDS environment variable which defaulted to 300 seconds.
  • batch — you can drop it. The SDK runs tool calls concurrently by default via ConcurrentToolExecutor, which also keeps tracing, metrics, and hooks intact. See Tool executors.
  • think → extended thinking — reasoning is now a model capability rather than a tool, so you configure it once instead of prompting for it. It is single-pass, so if you were relying on cycle_count to refine across passes, or on tool calls inside the reasoning loop, that pattern moves into your own orchestration. Config is per provider — see Amazon Bedrock.
  • current_timeContextInjector — the date is context, not something the agent should have to ask for, so injecting it means it is always fresh and the model cannot forget to call it. The trade-off is that your code picks the timezone; if you need the model to choose one per call, the official MCP time server still does that. See ContextInjector.
  • memory / retrieve → memory stores — memory is a first-class SDK concept now, so stores plug into the agent and inject context automatically instead of waiting to be called. store/retrieve become add/search. list, get, and delete are not part of the store protocol, so keep them as backend-native tools via get_tools(). One thing to know: the store returns relevance scores but does not filter on them, so if you relied on retrieve's default score >= 0.4 floor, apply it yourself. See Bedrock Knowledge Base store and Custom stores.
  • calculatorshell — run python3 -c with sympy for the same symbolic math. Worth being explicit: shell runs whatever it is given, whereas this tool checked expressions against an allowlist first. If you are evaluating untrusted input, put a sandbox behind the shell tool or keep your own validation in front of it.
  • cronshellcrontab through the shell tool covers scheduling on a host. Two things to plan for: the shell is sandbox-routed, so under Docker or SSH your jobs land in an environment that may not have a cron daemon, and you will be composing crontab lines yourself rather than using structured list/add/remove/edit actions. For scheduling that outlives the host, Amazon EventBridge Scheduler is usually the better fit.
  • environmentshellenv and printenv cover reading. Setting is genuinely different: a child shell cannot change the agent's own process environment, so variables need to be set where the agent is launched, or passed per call. If you were leaning on PROTECTED_VARS or secret masking, that guarding moves to your side.
  • slack → Slack's official MCP server — Slack maintains it, so it tracks their API directly, and it uses OAuth rather than long-lived tokens. It exposes a curated tool set rather than this tool's passthrough to any Web API method, and being request/response it does not cover Socket Mode or real-time events — slack_bolt remains the right tool for event listeners. Endpoint and setup: docs.slack.dev/ai/mcp-server.
  • diagram — no direct replacement, and that is deliberate: this tool was a wrapper over graphviz and the diagrams package, and a capable model writes that code well on its own. The wrapper mostly added a layer to keep in sync.
  • rss — no direct replacement. Fetching and parsing a feed is a few lines of feedparser, and the subscription list was a JSON file. If you were using feed HTTP Basic auth or the stored subscriptions, those move into your code.

💻 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")

Dynamic MCP Client Integration

⚠️SECURITY WARNING: The Dynamic MCP Client allows agents to autonomously connect to external MCP servers and load remote tools at runtime. This poses significant security risks as agents can potentially connect to malicious servers and execute untrusted code. Use with extreme caution in production environments.

This tool is different from the static MCP server implementation in the Strands SDK (see MCP Tools Documentation) which uses pre-configured, trusted MCP servers.

fromstrandsimportAgentfromstrands_toolsimportmcp_clientagent=Agent(tools=[mcp_client])
# Connect to a custom MCP server via stdioagent.tool.mcp_client(
action="connect",
connection_id="my_tools",
transport="stdio",
command="python",
args=["my_mcp_server.py"]
)
# List available tools on the servertools=agent.tool.mcp_client(
action="list_tools",
connection_id="my_tools"
)
# Call a tool from the MCP serverresult=agent.tool.mcp_client(
action="call_tool",
connection_id="my_tools",
tool_name="calculate",
tool_args={"x": 10, "y": 20}
)
# Connect to a SSE-based serveragent.tool.mcp_client(
action="connect",
connection_id="web_server",
transport="sse",
server_url="http://localhost:8080/sse"
)
# Connect to a streamable HTTP serveragent.tool.mcp_client(
action="connect",
connection_id="http_server",
transport="streamable_http",
server_url="https://api.example.com/mcp",
headers={"Authorization": "Bearer token"},
timeout=60
)
# Load MCP tools into agent's registry for direct access# ⚠️ WARNING: This loads external tools directly into the agentagent.tool.mcp_client(
action="load_tools",
connection_id="my_tools"
)
# Now you can call MCP tools directly as: agent.tool.calculate(x=10, y=20)

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
)

Tavily Search, Extract, Crawl, and Map

fromstrandsimportAgentfromstrands_tools.tavilyimport (
tavily_search, tavily_extract, tavily_crawl, tavily_map
)
# For async usage, call the corresponding *_async function with await.# Synchronous usage agent=Agent(tools=[tavily_search, tavily_extract, tavily_crawl, tavily_map])
# Real-time web searchresult=agent.tool.tavily_search(
query="Latest developments in renewable energy",
search_depth="advanced",
topic="news",
max_results=10,
include_raw_content=True
)
# Extract content from multiple URLsresult=agent.tool.tavily_extract(
urls=["www.tavily.com", "www.apple.com"],
extract_depth="advanced",
format="markdown"
)
# Advanced crawl with instructions and filteringresult=agent.tool.tavily_crawl(
url="www.tavily.com",
max_depth=2,
limit=50,
instructions="Find all API documentation and developer guides",
extract_depth="advanced",
include_images=True
)
# Basic website mappingresult=agent.tool.tavily_map(url="www.tavily.com")

Exa Search and Contents

fromstrandsimportAgentfromstrands_tools.exaimportexa_search, exa_get_contentsagent=Agent(tools=[exa_search, exa_get_contents])
# Basic search (auto mode is default and recommended)result=agent.tool.exa_search(
query="Best project management software",
text=True
)
# Company-specific search when neededresult=agent.tool.exa_search(
query="Anthropic AI safety research",
category="company",
include_domains=["anthropic.com"],
num_results=5,
summary={"query": "key research areas and findings"}
)
# News search with date filteringresult=agent.tool.exa_search(
query="AI regulation policy updates",
category="news",
start_published_date="2024-01-01T00:00:00.000Z",
text=True
)
# Get detailed content from specific URLsresult=agent.tool.exa_get_contents(
urls=[
"https://example.com/blog-post",
"https://github.com/microsoft/semantic-kernel"
],
text={"maxCharacters": 5000, "includeHtmlTags": False},
summary={
"query": "main points and practical applications"
},
subpages=2,
extras={"links": 5, "imageLinks": 2}
)
# Structured summary with JSON schemaresult=agent.tool.exa_get_contents(
urls=["https://example.com/article"],
summary={
"query": "main findings and recommendations",
"schema": {
"type": "object",
"properties": {
"main_points": {"type": "string", "description": "Key points from the article"},
"recommendations": {"type": "string", "description": "Suggested actions or advice"},
"conclusion": {"type": "string", "description": "Overall conclusion"},
"relevance": {"type": "string", "description": "Why this matters"}
},
"required": ["main_points", "conclusion"]
}
}
)

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()""")

Code Interpreter

fromstrandsimportAgentfromstrands_tools.code_interpreterimportAgentCoreCodeInterpreter# Create the code interpreter toolbedrock_agent_core_code_interpreter=AgentCoreCodeInterpreter(region="us-west-2")
agent=Agent(tools=[bedrock_agent_core_code_interpreter.code_interpreter])
# Create a sessionagent.tool.code_interpreter({
"action": {
"type": "initSession",
"description": "Data analysis session",
"session_name": "analysis-session"
}
})
# Execute Python codeagent.tool.code_interpreter({
"action": {
"type": "executeCode",
"session_name": "analysis-session",
"code": "print('Hello from sandbox!')",
"language": "python"
}
})

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"
)

Retrieve Tool

fromstrandsimportAgentfromstrands_toolsimportretrieveagent=Agent(tools=[retrieve])
# Basic retrieval without metadataresult=agent.tool.retrieve(
text="What is artificial intelligence?"
)
# Retrieval with metadata enabledresult=agent.tool.retrieve(
text="What are the latest developments in machine learning?",
enableMetadata=True
)
# Using environment variable to set default metadata behavior# Set RETRIEVE_ENABLE_METADATA_DEFAULT=true in your environmentresult=agent.tool.retrieve(
text="Tell me about cloud computing"# enableMetadata will default to the environment variable value
)

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"
}
},
]
)

Video Tools

fromstrandsimportAgentfromstrands_toolsimportsearch_video, chat_videoagent=Agent(tools=[search_video, chat_video])
# Search for video content using natural languageresult=agent.tool.search_video(
query="people discussing AI technology",
threshold="high",
group_by="video",
page_limit=5
)
# Chat with existing video (no index_id needed)result=agent.tool.chat_video(
prompt="What are the main topics discussed in this video?",
video_id="existing-video-id"
)
# Chat with new video file (index_id required for upload)result=agent.tool.chat_video(
prompt="Describe what happens in this video",
video_path="/path/to/video.mp4",
index_id="your-index-id"# or set TWELVELABS_PEGASUS_INDEX_ID env var
)

AgentCore Memory

fromstrandsimportAgentfromstrands_tools.agent_core_memoryimportAgentCoreMemoryToolProviderprovider=AgentCoreMemoryToolProvider(
memory_id="memory-123abc", # Requiredactor_id="user-456", # Requiredsession_id="session-789", # Requirednamespace="default", # Requiredregion="us-west-2"# Optional, defaults to us-west-2
)
agent=Agent(tools=provider.tools)
# Create a new memoryresult=agent.tool.agent_core_memory(
action="record",
content="I am allergic to shellfish"
)
# Search for relevant memoriesresult=agent.tool.agent_core_memory(
action="retrieve",
query="user preferences"
)
# List all memoriesresult=agent.tool.agent_core_memory(
action="list"
)
# Get a specific memory by IDresult=agent.tool.agent_core_memory(
action="get",
memory_record_id="mr-12345"
)

Browser

fromstrandsimportAgentfromstrands_tools.browserimportLocalChromiumBrowser# Create browser toolbrowser=LocalChromiumBrowser()
agent=Agent(tools=[browser.browser])
# Simple navigationresult=agent.tool.browser({
"action": {
"type": "navigate",
"url": "https://example.com"
}
})
# Initialize a session firstresult=agent.tool.browser({
"action": {
"type": "initSession",
"session_name": "main-session",
"description": "Web automation session"
}
})

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
)

Use Agent (Agent as Tool)

fromstrandsimportAgentfromstrands_toolsimportuse_agentagent=Agent(tools=[use_agent])
# Basic usage - inherits parent agent's modelresult=agent.tool.use_agent(
prompt="Tell me about the advantages of tool-building in AI agents",
system_prompt="You are a helpful AI assistant specializing in AI development concepts."
)
# Use a different model provider for specialized tasksresult=agent.tool.use_agent(
prompt="Calculate 2 + 2 and explain the result",
system_prompt="You are a helpful math assistant.",
model_provider="bedrock",
model_settings={
"model_id": "us.anthropic.claude-sonnet-4-20250514-v1:0"
},
tools=["calculator"]
)
# Use environment variables to determine modelimportosos.environ["STRANDS_PROVIDER"] ="ollama"os.environ["STRANDS_MODEL_ID"] ="qwen3:4b"result=agent.tool.use_agent(
prompt="Analyze this code",
system_prompt="You are a code review assistant.",
model_provider="env"
)
# Custom model configuration with specific parametersresult=agent.tool.use_agent(
prompt="Write a creative story",
system_prompt="You are a creative writing assistant.",
model_provider="github",
model_settings={
"model_id": "openai/o4-mini",
"params": {"temperature": 1, "max_tokens": 4000}
}
)

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

Diagram

fromstrandsimportAgentfromstrands_toolsimportdiagramagent=Agent(tools=[diagram])
# Create an AWS cloud architecture diagramresult=agent.tool.diagram(
diagram_type="cloud",
nodes=[
{"id": "users", "type": "Users", "label": "End Users"},
{"id": "cloudfront", "type": "CloudFront", "label": "CDN"},
{"id": "s3", "type": "S3", "label": "Static Assets"},
{"id": "api", "type": "APIGateway", "label": "API Gateway"},
{"id": "lambda", "type": "Lambda", "label": "Backend Service"}
],
edges=[
{"from": "users", "to": "cloudfront"},
{"from": "cloudfront", "to": "s3"},
{"from": "users", "to": "api"},
{"from": "api", "to": "lambda"}
],
title="Web Application Architecture"
)
# Create a UML class diagramresult=agent.tool.diagram(
diagram_type="class",
elements=[
{
"name": "User",
"attributes": ["+id: int", "-name: string", "#email: string"],
"methods": ["+login(): bool", "+logout(): void"]
},
{
"name": "Order",
"attributes": ["+id: int", "-items: List", "-total: float"],
"methods": ["+addItem(item): void", "+calculateTotal(): float"]
}
],
relationships=[
{"from": "User", "to": "Order", "type": "association", "multiplicity": "1..*"}
],
title="E-commerce Domain Model"
)

RSS Feed Management

fromstrandsimportAgentfromstrands_toolsimportrssagent=Agent(tools=[rss])
# Subscribe to a feedresult=agent.tool.rss(
action="subscribe",
url="https://news.example.com/rss/technology"
)
# List all subscribed feedsfeeds=agent.tool.rss(action="list")
# Read entries from a specific feedentries=agent.tool.rss(
action="read",
feed_id="news_example_com_technology",
max_entries=5,
include_content=True
)
# Search across all feedssearch_results=agent.tool.rss(
action="search",
query="machine learning",
max_entries=10
)
# Fetch feed content without subscribinglatest_news=agent.tool.rss(
action="fetch",
url="https://blog.example.org/feed",
max_entries=3
)

Use Computer

fromstrandsimportAgentfromstrands_toolsimportuse_computeragent=Agent(tools=[use_computer])
# Find mouse positionresult=agent.tool.use_computer(action="mouse_position")
# Automate adding textresult=agent.tool.use_computer(action="type", text="Hello, world!", app_name="Notepad")
# Analyze current computer screenresult=agent.tool.use_computer(action="analyze_screen")
result=agent.tool.use_computer(action="open_app", app_name="Calculator")
result=agent.tool.use_computer(action="close_app", app_name="Calendar")
result=agent.tool.use_computer(
action="hotkey",
hotkey_str="command+ctrl+f", # For macOSapp_name="Chrome"
)

Graph (Multi-Agent DAG)

Create deterministic DAG-based multi-agent pipelines where agents are nodes with dependency relationships. Unlike agent_graph (which uses persistent message-passing), graph uses task-based execution with output propagation.

fromstrandsimportAgentfromstrands_tools.graphimportgraphagent=Agent(tools=[graph])
# Create a multi-agent research pipelineresult=agent.tool.graph(
action="create",
graph_id="research_pipeline",
topology={
"nodes": [
{
"id": "researcher",
"role": "researcher",
"system_prompt": "You research topics thoroughly.",
"model_provider": "bedrock",
"model_settings": {"model_id": "us.anthropic.claude-sonnet-4-20250514-v1:0"}
},
{
"id": "analyst",
"role": "analyst",
"system_prompt": "You analyze research data.",
"model_provider": "bedrock",
"model_settings": {"model_id": "us.anthropic.claude-3-5-haiku-20241022-v1:0"}
},
{
"id": "reporter",
"role": "reporter",
"system_prompt": "You create comprehensive reports.",
"tools": ["file_write", "editor"]
}
],
"edges": [
{"from": "researcher", "to": "analyst"},
{"from": "analyst", "to": "reporter"}
],
"entry_points": ["researcher"]
}
)
# Execute a task through the graphresult=agent.tool.graph(
action="execute",
graph_id="research_pipeline",
task="Research and analyze the impact of AI on healthcare"
)
# Get graph statusresult=agent.tool.graph(action="status", graph_id="research_pipeline")
# List all graphsresult=agent.tool.graph(action="list")
# Delete a graphresult=agent.tool.graph(action="delete", graph_id="research_pipeline")

Elasticsearch Memory

Note: This tool requires AWS account credentials to generate embeddings using Amazon Bedrock Titan models.

fromstrandsimportAgentfromstrands_tools.elasticsearch_memoryimportElasticsearchMemoryTool, elasticsearch_memory# Bind connection, index, and namespace per principal (kept out of the agent-facing tool)memory_tool=ElasticsearchMemoryTool(
cloud_id="your-elasticsearch-cloud-id", # or es_url="https://...:443" for Serverlessapi_key="your-api-key",
index_name="memories",
namespace="user_123",
)
agent=Agent(tools=[memory_tool.elasticsearch_memory])
# Store a memory with semantic embeddingsresult=agent.tool.elasticsearch_memory(
action="record",
content="User prefers vegetarian pizza with extra cheese",
metadata={"category": "food_preferences", "type": "dietary"},
)
# Search memories using semantic similarity (vector search)result=agent.tool.elasticsearch_memory(
action="retrieve",
query="food preferences and dietary restrictions",
max_results=5,
)
# List all memories with paginationresult=agent.tool.elasticsearch_memory(action="list", max_results=10)
# Get specific memory by IDresult=agent.tool.elasticsearch_memory(action="get", memory_id="mem_1234567890_abcd1234")
# Delete a memoryresult=agent.tool.elasticsearch_memory(action="delete", memory_id="mem_1234567890_abcd1234")
# Single-tenant: use the standalone tool with configuration from environment variablesagent=Agent(tools=[elasticsearch_memory])
result=agent.tool.elasticsearch_memory(action="record", content="User prefers vegetarian pizza")

MongoDB Atlas Memory

Note: This tool requires AWS account credentials to generate embeddings using Amazon Bedrock Titan models.

fromstrandsimportAgentfromstrands_tools.mongodb_memoryimportMongoDBMemoryTool, mongodb_memory# Bind connection, collection, and namespace per principal (kept out of the agent-facing tool)memory_tool=MongoDBMemoryTool(
cluster_uri="mongodb+srv://username:password@cluster0.mongodb.net/?retryWrites=true&w=majority",
database_name="memories",
collection_name="user_memories",
namespace="user_123",
)
agent=Agent(tools=[memory_tool.mongodb_memory])
# Store a memory with semantic embeddingsresult=agent.tool.mongodb_memory(
action="record",
content="User prefers vegetarian pizza with extra cheese",
metadata={"category": "food_preferences", "type": "dietary"},
)
# Search memories using semantic similarity (vector search)result=agent.tool.mongodb_memory(
action="retrieve",
query="food preferences and dietary restrictions",
max_results=5,
)
# List all memories with paginationresult=agent.tool.mongodb_memory(action="list", max_results=10)
# Get specific memory by IDresult=agent.tool.mongodb_memory(action="get", memory_id="mem_1234567890_abcd1234")
# Delete a memoryresult=agent.tool.mongodb_memory(action="delete", memory_id="mem_1234567890_abcd1234")
# Single-tenant: use the standalone tool with configuration from environment variablesagent=Agent(tools=[mongodb_memory])
result=agent.tool.mongodb_memory(action="record", content="User prefers vegetarian pizza")

🌍 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_NON_INTERACTIVERun tools without interactive prompts, set to "true" to suppress confirmation dialogsfalseTools with a confirmation prompt (e.g. shell, 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

Tavily Search, Extract, Crawl, and Map Tools

Environment VariableDescriptionDefault
TAVILY_API_KEYTavily API key (required for all Tavily functionality)None

Exa Search and Contents Tools

Environment VariableDescriptionDefault
EXA_API_KEYExa API key (required for all Exa functionality)None

Mem0 Memory Tool

Security Model: The tenant-isolation keys (user_id / agent_id) are never exposed as agent-facing tool parameters. The agent only chooses the action and its content/query/memory_id. This prevents a model (or prompt-injected content) from reading, writing, or deleting another tenant's memories.

Usage patterns:

fromstrandsimportAgentfromstrands_tools.mem0_memoryimportMem0MemoryTool, mem0_memory# Multi-tenant (recommended): bind identity per authenticated principaltool=Mem0MemoryTool(user_id=f"user_{authenticated_user_id}")
agent=Agent(tools=[tool.mem0_memory])
agent.tool.mem0_memory(action="store", content="User prefers vegetarian pizza")
# Single-tenant: use the standalone function with env vars (MEM0_USER_ID / MEM0_AGENT_ID)agent=Agent(tools=[mem0_memory])
agent.tool.mem0_memory(action="store", content="User prefers vegetarian pizza")

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
  4. Neptune Analytics (Optional Graph backend for search enhancement):

    • Uses Neptune Analytics as the graph store backend to enhance memory recall.
    • Requires AWS credentials and Neptune Analytics configuration
    # Configure your Neptune Analytics graph ID in the .env file:
    export NEPTUNE_ANALYTICS_GRAPH_IDENTIFIER=sample-graph-id
    # Configure your Neptune Analytics graph ID in Python code:
    import os
    os.environ['NEPTUNE_ANALYTICS_GRAPH_IDENTIFIER'] = "g-sample-graph-id"
    
Environment VariableDescriptionDefaultRequired For
MEM0_USER_IDUser ID for memory operations (standalone function)NoneStandalone
MEM0_AGENT_IDAgent ID for memory operations (standalone function)NoneStandalone
MEM0_API_KEYMem0 Platform API keyNoneMem0 Platform
OPENSEARCH_HOSTOpenSearch Host URLNoneOpenSearch
AWS_REGIONAWS Region for OpenSearchus-west-2OpenSearch
NEPTUNE_ANALYTICS_GRAPH_IDENTIFIERNeptune Analytics Graph IdentifierNoneNeptune Analytics
DEVEnable development mode (bypasses confirmations)falseAll modes
MEM0_LLM_PROVIDERLLM provider for memory processingaws_bedrockAll modes
MEM0_LLM_MODELLLM model for memory processinganthropic.claude-3-5-haiku-20241022-v1:0All modes
MEM0_LLM_TEMPERATURELLM temperature (0.0-2.0)0.1All modes
MEM0_LLM_MAX_TOKENSLLM maximum tokens2000All modes
MEM0_EMBEDDER_PROVIDEREmbedder provider for vector embeddingsaws_bedrockAll modes
MEM0_EMBEDDER_MODELEmbedder model for vector embeddingsamazon.titan-embed-text-v2:0All 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)
  • If NEPTUNE_ANALYTICS_GRAPH_IDENTIFIER is set, the tool will configure Neptune Analytics as graph store to enhance memory search
  • LLM configuration applies to all backend modes and allows customization of the language model used for memory processing

Bright Data Tool

Environment VariableDescriptionDefault
BRIGHTDATA_API_KEYBright Data API KeyNone
BRIGHTDATA_ZONEBright Data Web Unlocker Zoneweb_unlocker1

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
PYTHON_REPL_INTERACTIVEWhether to enable interactive PTY modeNone
PYTHON_REPL_RESET_STATEWhether to reset the REPL state before executionNone
PYTHON_REPL_PERSISTENCE_DIRSet Directory for python_repl tool to write state fileNone

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
EDITOR_DISABLE_BACKUPSkip creating .bak backup files during edit operationsfalse

Environment Tool

Environment VariableDescriptionDefault
ENV_VARS_MASKED_DEFAULTMasking of values whose name contains TOKEN, SECRET, PASSWORD, KEY, or AUTH. Set to false to disable. This is the only way to configure masking: the agent cannot override it through tool input, and the environment tool cannot set it. Tools that execute arbitrary code in the agent process, such as python_repl and shell, can still write ittrue

HTTP Request Tool

Environment VariableDescriptionDefault
STRANDS_HTTP_ALLOW_INSECURE_SSLAllow disabling SSL certificate verification via verify_ssl parameterfalse

Dynamic MCP Client Tool

Environment VariableDescriptionDefault
STRANDS_MCP_TIMEOUTDefault timeout in seconds for MCP operations30.0

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

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

RSS Tool

Environment VariableDescriptionDefault
STRANDS_RSS_MAX_ENTRIESDefault setting for maximum number of entries per feed100
STRANDS_RSS_UPDATE_INTERVALDefault amount of time between updating rss feeds in minutes60
STRANDS_RSS_STORAGE_PATHDefault storage path where rss feeds are stored locallystrands_rss_feeds (this may vary based on your system)

Retrieve Tool

Environment VariableDescriptionDefault
RETRIEVE_ENABLE_METADATA_DEFAULTDefault setting for enabling metadata in retrieve tool responsesfalse

Use Agent Tool

Environment VariableDescriptionDefault
STRANDS_PROVIDERDefault model provider when using model_provider="env"ollama
STRANDS_MODEL_IDDefault model identifier for environment-based model selectionNone
STRANDS_MAX_TOKENSMaximum tokens for the nested agent modelNone
STRANDS_TEMPERATURESampling temperature for the nested agent modelNone

Elasticsearch Memory Tool

Environment VariableDescriptionDefault
ELASTICSEARCH_CLOUD_IDElasticsearch Cloud ID for connectionNone
ELASTICSEARCH_URLElasticsearch URL for serverless connectionNone
ELASTICSEARCH_API_KEYElasticsearch API key for authenticationNone
ELASTICSEARCH_INDEX_NAMEElasticsearch index name for memory storagestrands_memory
ELASTICSEARCH_NAMESPACENamespace for memory isolationdefault
ELASTICSEARCH_EMBEDDING_MODELAmazon Bedrock model for embeddingsamazon.titan-embed-text-v2:0
AWS_REGIONAWS region for Bedrock embedding serviceus-west-2

Note: This tool requires AWS account credentials to generate embeddings using Amazon Bedrock Titan models.

Graph Tool

The graph tool uses the same model provider environment variables as use_agent for per-node model configuration. No additional environment variables are required.

Video Tools

Environment VariableDescriptionDefault
TWELVELABS_API_KEYTwelveLabs API key for video analysisNone
TWELVELABS_MARENGO_INDEX_IDDefault index ID for search_video toolNone
TWELVELABS_PEGASUS_INDEX_IDDefault index ID for chat_video toolNone

MongoDB Atlas Memory Tool

Environment VariableDescriptionDefault
MONGODB_ATLAS_CLUSTER_URIMongoDB Atlas connection stringNone
MONGODB_DATABASE_NAMEDatabase name for MongoDB operationsstrands_memory
MONGODB_COLLECTION_NAMECollection name for MongoDB operationsmemories
MONGODB_NAMESPACENamespace for memory isolationdefault
MONGODB_EMBEDDING_MODELAmazon Bedrock model for embeddingsamazon.titan-embed-text-v2:0

Note: This tool requires AWS account credentials to generate embeddings using Amazon Bedrock Titan models.

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!

Stay in touch with the team

Come meet the Strands team and other users on Discord

License

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

Security

The tools in this repository are experimental and are provided as-is. Any production use should be preceded by an independent security review of the specific tools you enable.

For guidance on building and deploying agents safely, see Responsible AI in the Strands Agents documentation.

To report a security issue, 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 versionsStrands Discord

DocumentationSamplesPython SDKToolsAgent BuilderMCP Server

Strands Agents Tools is a community-driven project that 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, Amazon Bedrock Knowledge Bases, Elasticsearch, and MongoDB Atlas
  • 🕸️ Web Infrastructure - Perform web searches, extract page content, and crawl websites with Tavily and Exa-powered tools
  • 🌐 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
  • 🤖 Agent as Tool - Create nested agent instances with model switching support for multi-model workflows and specialized sub-tasks
  • 🔗 Multi-Agent Graph - Create and manage deterministic DAG-based multi-agent pipelines with output propagation and per-node model configuration
  • 🔌 Dynamic MCP Client - ⚠️ Dynamically connect to external MCP servers and load remote tools (use with caution - see security warnings)
  • 🔄 Multiple Tools per Turn - Call several other tools from one model response with Batch Tool
  • 🔍 Browser Tool - Tool giving an agent access to perform automated actions on a browser (chromium)
  • 📈 Diagram - Create AWS cloud diagrams, basic diagrams, or UML diagrams using python libraries
  • 📰 RSS Feed Manager - Subscribe, fetch, and process RSS feeds with content filtering and persistent storage
  • 🖱️ Computer Tool - Automate desktop actions including mouse movements, keyboard input, screenshots, and application management

Important

The tools in this repository are experimental. Many of them grant agents powerful capabilities — executing code, accessing the file system, calling AWS APIs, connecting to external servers, and automating browsers and desktops — which carry real security implications. Any production use should be preceded by your own independent security review; see the Responsible AI guidance for best practices. Use of these tools is at your own risk.

📦 Installation

Quick Install

pip install strands-agents-tools

To install the dependencies for optional tools:

pip install "strands-agents-tools[mem0_memory, use_browser, rss, use_computer]"

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
editor ⚠️agent.tool.editor(command="view", path="path/to/file.py")Advanced file operations like syntax highlighting, pattern replacement, and multi-file edits
Deprecated — see Deprecations
shell* ⚠️agent.tool.shell(command="ls -la")Executing shell commands, interacting with the operating system, running scripts
Deprecated — see Deprecations
http_requestagent.tool.http_request(method="GET", url="https://api.example.com/data")Making API calls, fetching web data, sending data to external services
tavily_searchagent.tool.tavily_search(query="What is artificial intelligence?", search_depth="advanced")Real-time web search optimized for AI agents with a variety of custom parameters
tavily_extractagent.tool.tavily_extract(urls=["www.tavily.com"], extract_depth="advanced")Extract clean, structured content from web pages with advanced processing and noise removal
tavily_crawlagent.tool.tavily_crawl(url="www.tavily.com", max_depth=2, instructions="Find API docs")Crawl websites intelligently starting from a base URL with filtering and extraction
tavily_mapagent.tool.tavily_map(url="www.tavily.com", max_depth=2, instructions="Find all pages")Map website structure and discover URLs starting from a base URL without content extraction
exa_searchagent.tool.exa_search(query="Best project management tools", text=True)Intelligent web search with auto mode (default) for optimal results, plus fast and deep search modes
exa_get_contentsagent.tool.exa_get_contents(urls=["https://example.com/article"], text=True, summary={"query": "key points"})Extract full content and summaries from specific URLs with live crawling fallback
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
calculator ⚠️agent.tool.calculator(expression="2 * sin(pi/4) + log(e**2)")Performing mathematical operations, symbolic math, equation solving
Deprecated — see Deprecations
code_interpretercode_interpreter = AgentCoreCodeInterpreter(region="us-west-2"); agent = Agent(tools=[code_interpreter.code_interpreter])Execute code in isolated sandbox environments with multi-language support (Python, JavaScript, TypeScript), persistent sessions, and file operations
use_awsagent.tool.use_aws(service_name="s3", operation_name="list_buckets", parameters={}, region="us-west-2")Interacting with AWS services, cloud resource management
retrieve ⚠️agent.tool.retrieve(text="What is STRANDS?")Retrieving information from Amazon Bedrock Knowledge Bases with optional metadata
Deprecated — see Deprecations
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
agent_core_memoryagent.tool.agent_core_memory(action="record", content="Hello, I like vegetarian food")Store and retrieve memories with Amazon Bedrock Agent Core Memory service
mem0_memoryagent.tool.mem0_memory(action="store", content="Remember I like to play tennis")Store user and agent memories across agent runs to provide personalized experience (tenant identity configured via Mem0MemoryTool or environment variables)
bright_dataagent.tool.bright_data(action="scrape_as_markdown", url="https://example.com")Web scraping, search queries, screenshot capture, and structured data extraction from websites and different data feeds
memory ⚠️agent.tool.memory(action="retrieve", query="product features")Store, retrieve, list, and manage documents in Amazon Bedrock Knowledge Bases with configurable parameters via environment variables
Deprecated — see Deprecations
environment ⚠️agent.tool.environment(action="list", prefix="AWS_")Managing environment variables, configuration management
Deprecated — see Deprecations
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
think ⚠️agent.tool.think(thought="Complex problem to analyze", cycle_count=3)Advanced reasoning, multi-step thinking processes
Deprecated — see Deprecations
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_time ⚠️agent.tool.current_time(timezone="US/Pacific")Get the current time in ISO 8601 format for a specified timezone
Deprecated — see Deprecations
sleep ⚠️agent.tool.sleep(seconds=5)Pause execution for the specified number of seconds, interruptible with SIGINT (Ctrl+C)
Deprecated — see Deprecations
agent_graphagent.tool.agent_graph(agents=["agent1", "agent2"], connections=[{"from": "agent1", "to": "agent2"}])Create and visualize agent relationship graphs for complex multi-agent systems
graphagent.tool.graph(action="create", graph_id="pipeline", topology={"nodes": [...], "edges": [...]})Create and manage deterministic DAG-based multi-agent graphs using Strands SDK Graph implementation with per-node model configuration
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
Deprecated — see Deprecations
slack ⚠️agent.tool.slack(action="post_message", channel="general", text="Hello team!")Interact with Slack workspace for messaging and monitoring
Deprecated — see Deprecations
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
use_agentagent.tool.use_agent(prompt="Analyze this code", system_prompt="You are a code analyst.", model_provider="bedrock")Create nested agent instances with model switching, multi-model workflows, cost optimization, and specialized sub-tasks
workflowagent.tool.workflow(action="create", name="data_pipeline", steps=[{"tool": "file_read"}, {"tool": "python_repl"}])Define, execute, and manage multi-step automated workflows
mcp_clientagent.tool.mcp_client(action="connect", connection_id="my_server", transport="stdio", command="python", args=["server.py"])⚠️SECURITY WARNING: Dynamically connect to external MCP servers via stdio, sse, or streamable_http, list tools, and call remote tools. This can pose security risks as agents may connect to malicious servers. Use with caution in production.
batch ⚠️agent.tool.batch(invocations=[{"name": "current_time", "arguments": {"timezone": "Europe/London"}}, {"name": "stop", "arguments": {}}])Call multiple other tools from one request.
Deprecated — see Deprecations
browserbrowser = LocalChromiumBrowser(); agent = Agent(tools=[browser.browser])Web scraping, automated testing, form filling, web automation tasks
diagram ⚠️agent.tool.diagram(diagram_type="cloud", nodes=[{"id": "s3", "type": "S3"}], edges=[])Create AWS cloud architecture diagrams, network diagrams, graphs, and UML diagrams (all 14 types)
Deprecated — see Deprecations
rss ⚠️agent.tool.rss(action="subscribe", url="https://example.com/feed.xml", feed_id="tech_news")Manage RSS feeds: subscribe, fetch, read, search, and update content from various sources
Deprecated — see Deprecations
use_computeragent.tool.use_computer(action="click", x=100, y=200, app_name="Chrome") Desktop automation, GUI interaction, screen capture
search_videoagent.tool.search_video(query="people discussing AI")Semantic video search using TwelveLabs' Marengo model
chat_videoagent.tool.chat_video(prompt="What are the main topics?", video_id="video_123")Interactive video analysis using TwelveLabs' Pegasus model
mongodb_memoryagent.tool.mongodb_memory(action="record", content="User prefers vegetarian pizza")Store and retrieve memories using MongoDB Atlas with semantic search via AWS Bedrock Titan embeddings (connection and namespace configured via MongoDBMemoryTool or environment variables)
elasticsearch_memoryagent.tool.elasticsearch_memory(action="record", content="User prefers dark mode")Store and retrieve memories using Elasticsearch with semantic search via AWS Bedrock Titan embeddings (connection and namespace configured via ElasticsearchMemoryTool or environment variables)

* These tools do not work on Windows

Deprecations

The tools below are deprecated, and each row points to where that capability now lives.

When this package started, the SDK had no built-in way to do most of these things, so we shipped tools to fill the gap. Much of that is now native: the SDK reasons, injects context, manages memory, and runs tools concurrently on its own, and where a vendor maintains an official MCP server, that server will always track their API better than a wrapper here can. Keeping a second implementation alongside means two things to fix and two things to drift, so we would rather point you at the one that gets the attention.

More tools will follow as their capabilities land elsewhere, and this repository will eventually be archived. Nothing breaks suddenly — but migrating when a tool is first deprecated is easier than moving several at once later.

Deprecated tools keep working. Each one logs a warning when invoked starting in v0.8.6, and that warning becomes an error log in v0.9.0 — a louder signal for anyone who has not migrated, not a behavior change.

They are also marked with @typing_extensions.deprecated, so type checkers and IDEs flag usage before you run anything. To list what you still need to migrate, run mypy --enable-error-code deprecated over your project: it reports the from strands_tools import ... line for each deprecated tool, without invoking any of them. Prefer mypy here: pyright, with reportDeprecated enabled, reports direct calls such as calculator(expression=...) but not agent.tool.calculator(...), and it reaches the import line for only the three tools whose marker is not wrapped by @tool. Note that Python suppresses the resulting DeprecationWarning at runtime when the agent invokes a tool, which is why the log message exists as well.

ToolSuggested alternativeWarningError log
sleepfrom strands.vended_tools import sleepv0.8.6v0.9.0
editorfrom strands.vended_tools import file_editorv0.8.6v0.9.0
shellfrom strands.vended_tools import bashv0.8.6v0.9.0
batchnone needed — concurrent tool execution is the SDK default (docs)v0.8.6v0.9.0
thinknative extended thinking via model reasoning config (docs)v0.8.6v0.9.0
current_timeContextInjector (docs)v0.8.6v0.9.0
memoryMemoryManager + BedrockKnowledgeBaseStore (docs)v0.8.6v0.9.0
retrieveMemoryManager + BedrockKnowledgeBaseStore(writable=False) (docs)v0.8.6v0.9.0
calculatorfrom strands.vended_tools import bash (run python3 -c with sympy)v0.8.6v0.9.0
cronfrom strands.vended_tools import bash (manage crontab), or Amazon EventBridge Schedulerv0.8.6v0.9.0
environmentfrom strands.vended_tools import bash (inspect only, see notes)v0.8.6v0.9.0
slackofficial Slack MCP server; slack_bolt for Socket Modev0.8.6v0.9.0
diagramno replacement — have the model write graphviz/mermaid/diagrams code directlyv0.8.6v0.9.0
rssno replacement — parse feeds directly with feedparserv0.8.6v0.9.0
# BeforefromstrandsimportAgentfromstrands_toolsimporteditor, shell, sleepagent=Agent(tools=[editor, shell, sleep])
# AfterfromstrandsimportAgentfromstrands.vended_toolsimportbash, file_editor, sleepagent=Agent(tools=[bash, file_editor, sleep])

Behavior differences

The replacements are not drop-in equivalents. Check these before migrating:

  • shellbash: the SDK tool routes commands through the agent's configured sandbox and is stateless — each call runs in a fresh shell, so variables and the working directory do not persist between calls. It does not provide PTY support or batched parallel/sequential command execution.
  • editorfile_editor: supports view, create, str_replace, and insert. The pattern_replace, find_line, and undo_edit commands have no SDK equivalent.
  • sleepsleep: the maximum duration is set with make_sleep(max_duration=...) and defaults to 60 seconds, replacing the MAX_SLEEP_SECONDS environment variable which defaulted to 300 seconds.
  • batch — you can drop it. The SDK runs tool calls concurrently by default via ConcurrentToolExecutor, which also keeps tracing, metrics, and hooks intact. See Tool executors.
  • think → extended thinking — reasoning is now a model capability rather than a tool, so you configure it once instead of prompting for it. It is single-pass, so if you were relying on cycle_count to refine across passes, or on tool calls inside the reasoning loop, that pattern moves into your own orchestration. Config is per provider — see Amazon Bedrock.
  • current_timeContextInjector — the date is context, not something the agent should have to ask for, so injecting it means it is always fresh and the model cannot forget to call it. The trade-off is that your code picks the timezone; if you need the model to choose one per call, the official MCP time server still does that. See ContextInjector.
  • memory / retrieve → memory stores — memory is a first-class SDK concept now, so stores plug into the agent and inject context automatically instead of waiting to be called. store/retrieve become add/search. list, get, and delete are not part of the store protocol, so keep them as backend-native tools via get_tools(). One thing to know: the store returns relevance scores but does not filter on them, so if you relied on retrieve's default score >= 0.4 floor, apply it yourself. See Bedrock Knowledge Base store and Custom stores.
  • calculatorshell — run python3 -c with sympy for the same symbolic math. Worth being explicit: shell runs whatever it is given, whereas this tool checked expressions against an allowlist first. If you are evaluating untrusted input, put a sandbox behind the shell tool or keep your own validation in front of it.
  • cronshellcrontab through the shell tool covers scheduling on a host. Two things to plan for: the shell is sandbox-routed, so under Docker or SSH your jobs land in an environment that may not have a cron daemon, and you will be composing crontab lines yourself rather than using structured list/add/remove/edit actions. For scheduling that outlives the host, Amazon EventBridge Scheduler is usually the better fit.
  • environmentshellenv and printenv cover reading. Setting is genuinely different: a child shell cannot change the agent's own process environment, so variables need to be set where the agent is launched, or passed per call. If you were leaning on PROTECTED_VARS or secret masking, that guarding moves to your side.
  • slack → Slack's official MCP server — Slack maintains it, so it tracks their API directly, and it uses OAuth rather than long-lived tokens. It exposes a curated tool set rather than this tool's passthrough to any Web API method, and being request/response it does not cover Socket Mode or real-time events — slack_bolt remains the right tool for event listeners. Endpoint and setup: docs.slack.dev/ai/mcp-server.
  • diagram — no direct replacement, and that is deliberate: this tool was a wrapper over graphviz and the diagrams package, and a capable model writes that code well on its own. The wrapper mostly added a layer to keep in sync.
  • rss — no direct replacement. Fetching and parsing a feed is a few lines of feedparser, and the subscription list was a JSON file. If you were using feed HTTP Basic auth or the stored subscriptions, those move into your code.

💻 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")

Dynamic MCP Client Integration

⚠️SECURITY WARNING: The Dynamic MCP Client allows agents to autonomously connect to external MCP servers and load remote tools at runtime. This poses significant security risks as agents can potentially connect to malicious servers and execute untrusted code. Use with extreme caution in production environments.

This tool is different from the static MCP server implementation in the Strands SDK (see MCP Tools Documentation) which uses pre-configured, trusted MCP servers.

fromstrandsimportAgentfromstrands_toolsimportmcp_clientagent=Agent(tools=[mcp_client])
# Connect to a custom MCP server via stdioagent.tool.mcp_client(
action="connect",
connection_id="my_tools",
transport="stdio",
command="python",
args=["my_mcp_server.py"]
)
# List available tools on the servertools=agent.tool.mcp_client(
action="list_tools",
connection_id="my_tools"
)
# Call a tool from the MCP serverresult=agent.tool.mcp_client(
action="call_tool",
connection_id="my_tools",
tool_name="calculate",
tool_args={"x": 10, "y": 20}
)
# Connect to a SSE-based serveragent.tool.mcp_client(
action="connect",
connection_id="web_server",
transport="sse",
server_url="http://localhost:8080/sse"
)
# Connect to a streamable HTTP serveragent.tool.mcp_client(
action="connect",
connection_id="http_server",
transport="streamable_http",
server_url="https://api.example.com/mcp",
headers={"Authorization": "Bearer token"},
timeout=60
)
# Load MCP tools into agent's registry for direct access# ⚠️ WARNING: This loads external tools directly into the agentagent.tool.mcp_client(
action="load_tools",
connection_id="my_tools"
)
# Now you can call MCP tools directly as: agent.tool.calculate(x=10, y=20)

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
)

Tavily Search, Extract, Crawl, and Map

fromstrandsimportAgentfromstrands_tools.tavilyimport (
tavily_search, tavily_extract, tavily_crawl, tavily_map
)
# For async usage, call the corresponding *_async function with await.# Synchronous usage agent=Agent(tools=[tavily_search, tavily_extract, tavily_crawl, tavily_map])
# Real-time web searchresult=agent.tool.tavily_search(
query="Latest developments in renewable energy",
search_depth="advanced",
topic="news",
max_results=10,
include_raw_content=True
)
# Extract content from multiple URLsresult=agent.tool.tavily_extract(
urls=["www.tavily.com", "www.apple.com"],
extract_depth="advanced",
format="markdown"
)
# Advanced crawl with instructions and filteringresult=agent.tool.tavily_crawl(
url="www.tavily.com",
max_depth=2,
limit=50,
instructions="Find all API documentation and developer guides",
extract_depth="advanced",
include_images=True
)
# Basic website mappingresult=agent.tool.tavily_map(url="www.tavily.com")

Exa Search and Contents

fromstrandsimportAgentfromstrands_tools.exaimportexa_search, exa_get_contentsagent=Agent(tools=[exa_search, exa_get_contents])
# Basic search (auto mode is default and recommended)result=agent.tool.exa_search(
query="Best project management software",
text=True
)
# Company-specific search when neededresult=agent.tool.exa_search(
query="Anthropic AI safety research",
category="company",
include_domains=["anthropic.com"],
num_results=5,
summary={"query": "key research areas and findings"}
)
# News search with date filteringresult=agent.tool.exa_search(
query="AI regulation policy updates",
category="news",
start_published_date="2024-01-01T00:00:00.000Z",
text=True
)
# Get detailed content from specific URLsresult=agent.tool.exa_get_contents(
urls=[
"https://example.com/blog-post",
"https://github.com/microsoft/semantic-kernel"
],
text={"maxCharacters": 5000, "includeHtmlTags": False},
summary={
"query": "main points and practical applications"
},
subpages=2,
extras={"links": 5, "imageLinks": 2}
)
# Structured summary with JSON schemaresult=agent.tool.exa_get_contents(
urls=["https://example.com/article"],
summary={
"query": "main findings and recommendations",
"schema": {
"type": "object",
"properties": {
"main_points": {"type": "string", "description": "Key points from the article"},
"recommendations": {"type": "string", "description": "Suggested actions or advice"},
"conclusion": {"type": "string", "description": "Overall conclusion"},
"relevance": {"type": "string", "description": "Why this matters"}
},
"required": ["main_points", "conclusion"]
}
}
)

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()""")

Code Interpreter

fromstrandsimportAgentfromstrands_tools.code_interpreterimportAgentCoreCodeInterpreter# Create the code interpreter toolbedrock_agent_core_code_interpreter=AgentCoreCodeInterpreter(region="us-west-2")
agent=Agent(tools=[bedrock_agent_core_code_interpreter.code_interpreter])
# Create a sessionagent.tool.code_interpreter({
"action": {
"type": "initSession",
"description": "Data analysis session",
"session_name": "analysis-session"
}
})
# Execute Python codeagent.tool.code_interpreter({
"action": {
"type": "executeCode",
"session_name": "analysis-session",
"code": "print('Hello from sandbox!')",
"language": "python"
}
})

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"
)

Retrieve Tool

fromstrandsimportAgentfromstrands_toolsimportretrieveagent=Agent(tools=[retrieve])
# Basic retrieval without metadataresult=agent.tool.retrieve(
text="What is artificial intelligence?"
)
# Retrieval with metadata enabledresult=agent.tool.retrieve(
text="What are the latest developments in machine learning?",
enableMetadata=True
)
# Using environment variable to set default metadata behavior# Set RETRIEVE_ENABLE_METADATA_DEFAULT=true in your environmentresult=agent.tool.retrieve(
text="Tell me about cloud computing"# enableMetadata will default to the environment variable value
)

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"
}
},
]
)

Video Tools

fromstrandsimportAgentfromstrands_toolsimportsearch_video, chat_videoagent=Agent(tools=[search_video, chat_video])
# Search for video content using natural languageresult=agent.tool.search_video(
query="people discussing AI technology",
threshold="high",
group_by="video",
page_limit=5
)
# Chat with existing video (no index_id needed)result=agent.tool.chat_video(
prompt="What are the main topics discussed in this video?",
video_id="existing-video-id"
)
# Chat with new video file (index_id required for upload)result=agent.tool.chat_video(
prompt="Describe what happens in this video",
video_path="/path/to/video.mp4",
index_id="your-index-id"# or set TWELVELABS_PEGASUS_INDEX_ID env var
)

AgentCore Memory

fromstrandsimportAgentfromstrands_tools.agent_core_memoryimportAgentCoreMemoryToolProviderprovider=AgentCoreMemoryToolProvider(
memory_id="memory-123abc", # Requiredactor_id="user-456", # Requiredsession_id="session-789", # Requirednamespace="default", # Requiredregion="us-west-2"# Optional, defaults to us-west-2
)
agent=Agent(tools=provider.tools)
# Create a new memoryresult=agent.tool.agent_core_memory(
action="record",
content="I am allergic to shellfish"
)
# Search for relevant memoriesresult=agent.tool.agent_core_memory(
action="retrieve",
query="user preferences"
)
# List all memoriesresult=agent.tool.agent_core_memory(
action="list"
)
# Get a specific memory by IDresult=agent.tool.agent_core_memory(
action="get",
memory_record_id="mr-12345"
)

Browser

fromstrandsimportAgentfromstrands_tools.browserimportLocalChromiumBrowser# Create browser toolbrowser=LocalChromiumBrowser()
agent=Agent(tools=[browser.browser])
# Simple navigationresult=agent.tool.browser({
"action": {
"type": "navigate",
"url": "https://example.com"
}
})
# Initialize a session firstresult=agent.tool.browser({
"action": {
"type": "initSession",
"session_name": "main-session",
"description": "Web automation session"
}
})

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
)

Use Agent (Agent as Tool)

fromstrandsimportAgentfromstrands_toolsimportuse_agentagent=Agent(tools=[use_agent])
# Basic usage - inherits parent agent's modelresult=agent.tool.use_agent(
prompt="Tell me about the advantages of tool-building in AI agents",
system_prompt="You are a helpful AI assistant specializing in AI development concepts."
)
# Use a different model provider for specialized tasksresult=agent.tool.use_agent(
prompt="Calculate 2 + 2 and explain the result",
system_prompt="You are a helpful math assistant.",
model_provider="bedrock",
model_settings={
"model_id": "us.anthropic.claude-sonnet-4-20250514-v1:0"
},
tools=["calculator"]
)
# Use environment variables to determine modelimportosos.environ["STRANDS_PROVIDER"] ="ollama"os.environ["STRANDS_MODEL_ID"] ="qwen3:4b"result=agent.tool.use_agent(
prompt="Analyze this code",
system_prompt="You are a code review assistant.",
model_provider="env"
)
# Custom model configuration with specific parametersresult=agent.tool.use_agent(
prompt="Write a creative story",
system_prompt="You are a creative writing assistant.",
model_provider="github",
model_settings={
"model_id": "openai/o4-mini",
"params": {"temperature": 1, "max_tokens": 4000}
}
)

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

Diagram

fromstrandsimportAgentfromstrands_toolsimportdiagramagent=Agent(tools=[diagram])
# Create an AWS cloud architecture diagramresult=agent.tool.diagram(
diagram_type="cloud",
nodes=[
{"id": "users", "type": "Users", "label": "End Users"},
{"id": "cloudfront", "type": "CloudFront", "label": "CDN"},
{"id": "s3", "type": "S3", "label": "Static Assets"},
{"id": "api", "type": "APIGateway", "label": "API Gateway"},
{"id": "lambda", "type": "Lambda", "label": "Backend Service"}
],
edges=[
{"from": "users", "to": "cloudfront"},
{"from": "cloudfront", "to": "s3"},
{"from": "users", "to": "api"},
{"from": "api", "to": "lambda"}
],
title="Web Application Architecture"
)
# Create a UML class diagramresult=agent.tool.diagram(
diagram_type="class",
elements=[
{
"name": "User",
"attributes": ["+id: int", "-name: string", "#email: string"],
"methods": ["+login(): bool", "+logout(): void"]
},
{
"name": "Order",
"attributes": ["+id: int", "-items: List", "-total: float"],
"methods": ["+addItem(item): void", "+calculateTotal(): float"]
}
],
relationships=[
{"from": "User", "to": "Order", "type": "association", "multiplicity": "1..*"}
],
title="E-commerce Domain Model"
)

RSS Feed Management

fromstrandsimportAgentfromstrands_toolsimportrssagent=Agent(tools=[rss])
# Subscribe to a feedresult=agent.tool.rss(
action="subscribe",
url="https://news.example.com/rss/technology"
)
# List all subscribed feedsfeeds=agent.tool.rss(action="list")
# Read entries from a specific feedentries=agent.tool.rss(
action="read",
feed_id="news_example_com_technology",
max_entries=5,
include_content=True
)
# Search across all feedssearch_results=agent.tool.rss(
action="search",
query="machine learning",
max_entries=10
)
# Fetch feed content without subscribinglatest_news=agent.tool.rss(
action="fetch",
url="https://blog.example.org/feed",
max_entries=3
)

Use Computer

fromstrandsimportAgentfromstrands_toolsimportuse_computeragent=Agent(tools=[use_computer])
# Find mouse positionresult=agent.tool.use_computer(action="mouse_position")
# Automate adding textresult=agent.tool.use_computer(action="type", text="Hello, world!", app_name="Notepad")
# Analyze current computer screenresult=agent.tool.use_computer(action="analyze_screen")
result=agent.tool.use_computer(action="open_app", app_name="Calculator")
result=agent.tool.use_computer(action="close_app", app_name="Calendar")
result=agent.tool.use_computer(
action="hotkey",
hotkey_str="command+ctrl+f", # For macOSapp_name="Chrome"
)

Graph (Multi-Agent DAG)

Create deterministic DAG-based multi-agent pipelines where agents are nodes with dependency relationships. Unlike agent_graph (which uses persistent message-passing), graph uses task-based execution with output propagation.

fromstrandsimportAgentfromstrands_tools.graphimportgraphagent=Agent(tools=[graph])
# Create a multi-agent research pipelineresult=agent.tool.graph(
action="create",
graph_id="research_pipeline",
topology={
"nodes": [
{
"id": "researcher",
"role": "researcher",
"system_prompt": "You research topics thoroughly.",
"model_provider": "bedrock",
"model_settings": {"model_id": "us.anthropic.claude-sonnet-4-20250514-v1:0"}
},
{
"id": "analyst",
"role": "analyst",
"system_prompt": "You analyze research data.",
"model_provider": "bedrock",
"model_settings": {"model_id": "us.anthropic.claude-3-5-haiku-20241022-v1:0"}
},
{
"id": "reporter",
"role": "reporter",
"system_prompt": "You create comprehensive reports.",
"tools": ["file_write", "editor"]
}
],
"edges": [
{"from": "researcher", "to": "analyst"},
{"from": "analyst", "to": "reporter"}
],
"entry_points": ["researcher"]
}
)
# Execute a task through the graphresult=agent.tool.graph(
action="execute",
graph_id="research_pipeline",
task="Research and analyze the impact of AI on healthcare"
)
# Get graph statusresult=agent.tool.graph(action="status", graph_id="research_pipeline")
# List all graphsresult=agent.tool.graph(action="list")
# Delete a graphresult=agent.tool.graph(action="delete", graph_id="research_pipeline")

Elasticsearch Memory

Note: This tool requires AWS account credentials to generate embeddings using Amazon Bedrock Titan models.

fromstrandsimportAgentfromstrands_tools.elasticsearch_memoryimportElasticsearchMemoryTool, elasticsearch_memory# Bind connection, index, and namespace per principal (kept out of the agent-facing tool)memory_tool=ElasticsearchMemoryTool(
cloud_id="your-elasticsearch-cloud-id", # or es_url="https://...:443" for Serverlessapi_key="your-api-key",
index_name="memories",
namespace="user_123",
)
agent=Agent(tools=[memory_tool.elasticsearch_memory])
# Store a memory with semantic embeddingsresult=agent.tool.elasticsearch_memory(
action="record",
content="User prefers vegetarian pizza with extra cheese",
metadata={"category": "food_preferences", "type": "dietary"},
)
# Search memories using semantic similarity (vector search)result=agent.tool.elasticsearch_memory(
action="retrieve",
query="food preferences and dietary restrictions",
max_results=5,
)
# List all memories with paginationresult=agent.tool.elasticsearch_memory(action="list", max_results=10)
# Get specific memory by IDresult=agent.tool.elasticsearch_memory(action="get", memory_id="mem_1234567890_abcd1234")
# Delete a memoryresult=agent.tool.elasticsearch_memory(action="delete", memory_id="mem_1234567890_abcd1234")
# Single-tenant: use the standalone tool with configuration from environment variablesagent=Agent(tools=[elasticsearch_memory])
result=agent.tool.elasticsearch_memory(action="record", content="User prefers vegetarian pizza")

MongoDB Atlas Memory

Note: This tool requires AWS account credentials to generate embeddings using Amazon Bedrock Titan models.

fromstrandsimportAgentfromstrands_tools.mongodb_memoryimportMongoDBMemoryTool, mongodb_memory# Bind connection, collection, and namespace per principal (kept out of the agent-facing tool)memory_tool=MongoDBMemoryTool(
cluster_uri="mongodb+srv://username:password@cluster0.mongodb.net/?retryWrites=true&w=majority",
database_name="memories",
collection_name="user_memories",
namespace="user_123",
)
agent=Agent(tools=[memory_tool.mongodb_memory])
# Store a memory with semantic embeddingsresult=agent.tool.mongodb_memory(
action="record",
content="User prefers vegetarian pizza with extra cheese",
metadata={"category": "food_preferences", "type": "dietary"},
)
# Search memories using semantic similarity (vector search)result=agent.tool.mongodb_memory(
action="retrieve",
query="food preferences and dietary restrictions",
max_results=5,
)
# List all memories with paginationresult=agent.tool.mongodb_memory(action="list", max_results=10)
# Get specific memory by IDresult=agent.tool.mongodb_memory(action="get", memory_id="mem_1234567890_abcd1234")
# Delete a memoryresult=agent.tool.mongodb_memory(action="delete", memory_id="mem_1234567890_abcd1234")
# Single-tenant: use the standalone tool with configuration from environment variablesagent=Agent(tools=[mongodb_memory])
result=agent.tool.mongodb_memory(action="record", content="User prefers vegetarian pizza")

🌍 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_NON_INTERACTIVERun tools without interactive prompts, set to "true" to suppress confirmation dialogsfalseTools with a confirmation prompt (e.g. shell, 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

Tavily Search, Extract, Crawl, and Map Tools

Environment VariableDescriptionDefault
TAVILY_API_KEYTavily API key (required for all Tavily functionality)None

Exa Search and Contents Tools

Environment VariableDescriptionDefault
EXA_API_KEYExa API key (required for all Exa functionality)None

Mem0 Memory Tool

Security Model: The tenant-isolation keys (user_id / agent_id) are never exposed as agent-facing tool parameters. The agent only chooses the action and its content/query/memory_id. This prevents a model (or prompt-injected content) from reading, writing, or deleting another tenant's memories.

Usage patterns:

fromstrandsimportAgentfromstrands_tools.mem0_memoryimportMem0MemoryTool, mem0_memory# Multi-tenant (recommended): bind identity per authenticated principaltool=Mem0MemoryTool(user_id=f"user_{authenticated_user_id}")
agent=Agent(tools=[tool.mem0_memory])
agent.tool.mem0_memory(action="store", content="User prefers vegetarian pizza")
# Single-tenant: use the standalone function with env vars (MEM0_USER_ID / MEM0_AGENT_ID)agent=Agent(tools=[mem0_memory])
agent.tool.mem0_memory(action="store", content="User prefers vegetarian pizza")

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
  4. Neptune Analytics (Optional Graph backend for search enhancement):

    • Uses Neptune Analytics as the graph store backend to enhance memory recall.
    • Requires AWS credentials and Neptune Analytics configuration
    # Configure your Neptune Analytics graph ID in the .env file:
    export NEPTUNE_ANALYTICS_GRAPH_IDENTIFIER=sample-graph-id
    # Configure your Neptune Analytics graph ID in Python code:
    import os
    os.environ['NEPTUNE_ANALYTICS_GRAPH_IDENTIFIER'] = "g-sample-graph-id"
    
Environment VariableDescriptionDefaultRequired For
MEM0_USER_IDUser ID for memory operations (standalone function)NoneStandalone
MEM0_AGENT_IDAgent ID for memory operations (standalone function)NoneStandalone
MEM0_API_KEYMem0 Platform API keyNoneMem0 Platform
OPENSEARCH_HOSTOpenSearch Host URLNoneOpenSearch
AWS_REGIONAWS Region for OpenSearchus-west-2OpenSearch
NEPTUNE_ANALYTICS_GRAPH_IDENTIFIERNeptune Analytics Graph IdentifierNoneNeptune Analytics
DEVEnable development mode (bypasses confirmations)falseAll modes
MEM0_LLM_PROVIDERLLM provider for memory processingaws_bedrockAll modes
MEM0_LLM_MODELLLM model for memory processinganthropic.claude-3-5-haiku-20241022-v1:0All modes
MEM0_LLM_TEMPERATURELLM temperature (0.0-2.0)0.1All modes
MEM0_LLM_MAX_TOKENSLLM maximum tokens2000All modes
MEM0_EMBEDDER_PROVIDEREmbedder provider for vector embeddingsaws_bedrockAll modes
MEM0_EMBEDDER_MODELEmbedder model for vector embeddingsamazon.titan-embed-text-v2:0All 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)
  • If NEPTUNE_ANALYTICS_GRAPH_IDENTIFIER is set, the tool will configure Neptune Analytics as graph store to enhance memory search
  • LLM configuration applies to all backend modes and allows customization of the language model used for memory processing

Bright Data Tool

Environment VariableDescriptionDefault
BRIGHTDATA_API_KEYBright Data API KeyNone
BRIGHTDATA_ZONEBright Data Web Unlocker Zoneweb_unlocker1

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
PYTHON_REPL_INTERACTIVEWhether to enable interactive PTY modeNone
PYTHON_REPL_RESET_STATEWhether to reset the REPL state before executionNone
PYTHON_REPL_PERSISTENCE_DIRSet Directory for python_repl tool to write state fileNone

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
EDITOR_DISABLE_BACKUPSkip creating .bak backup files during edit operationsfalse

Environment Tool

Environment VariableDescriptionDefault
ENV_VARS_MASKED_DEFAULTMasking of values whose name contains TOKEN, SECRET, PASSWORD, KEY, or AUTH. Set to false to disable. This is the only way to configure masking: the agent cannot override it through tool input, and the environment tool cannot set it. Tools that execute arbitrary code in the agent process, such as python_repl and shell, can still write ittrue

HTTP Request Tool

Environment VariableDescriptionDefault
STRANDS_HTTP_ALLOW_INSECURE_SSLAllow disabling SSL certificate verification via verify_ssl parameterfalse

Dynamic MCP Client Tool

Environment VariableDescriptionDefault
STRANDS_MCP_TIMEOUTDefault timeout in seconds for MCP operations30.0

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

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

RSS Tool

Environment VariableDescriptionDefault
STRANDS_RSS_MAX_ENTRIESDefault setting for maximum number of entries per feed100
STRANDS_RSS_UPDATE_INTERVALDefault amount of time between updating rss feeds in minutes60
STRANDS_RSS_STORAGE_PATHDefault storage path where rss feeds are stored locallystrands_rss_feeds (this may vary based on your system)

Retrieve Tool

Environment VariableDescriptionDefault
RETRIEVE_ENABLE_METADATA_DEFAULTDefault setting for enabling metadata in retrieve tool responsesfalse

Use Agent Tool

Environment VariableDescriptionDefault
STRANDS_PROVIDERDefault model provider when using model_provider="env"ollama
STRANDS_MODEL_IDDefault model identifier for environment-based model selectionNone
STRANDS_MAX_TOKENSMaximum tokens for the nested agent modelNone
STRANDS_TEMPERATURESampling temperature for the nested agent modelNone

Elasticsearch Memory Tool

Environment VariableDescriptionDefault
ELASTICSEARCH_CLOUD_IDElasticsearch Cloud ID for connectionNone
ELASTICSEARCH_URLElasticsearch URL for serverless connectionNone
ELASTICSEARCH_API_KEYElasticsearch API key for authenticationNone
ELASTICSEARCH_INDEX_NAMEElasticsearch index name for memory storagestrands_memory
ELASTICSEARCH_NAMESPACENamespace for memory isolationdefault
ELASTICSEARCH_EMBEDDING_MODELAmazon Bedrock model for embeddingsamazon.titan-embed-text-v2:0
AWS_REGIONAWS region for Bedrock embedding serviceus-west-2

Note: This tool requires AWS account credentials to generate embeddings using Amazon Bedrock Titan models.

Graph Tool

The graph tool uses the same model provider environment variables as use_agent for per-node model configuration. No additional environment variables are required.

Video Tools

Environment VariableDescriptionDefault
TWELVELABS_API_KEYTwelveLabs API key for video analysisNone
TWELVELABS_MARENGO_INDEX_IDDefault index ID for search_video toolNone
TWELVELABS_PEGASUS_INDEX_IDDefault index ID for chat_video toolNone

MongoDB Atlas Memory Tool

Environment VariableDescriptionDefault
MONGODB_ATLAS_CLUSTER_URIMongoDB Atlas connection stringNone
MONGODB_DATABASE_NAMEDatabase name for MongoDB operationsstrands_memory
MONGODB_COLLECTION_NAMECollection name for MongoDB operationsmemories
MONGODB_NAMESPACENamespace for memory isolationdefault
MONGODB_EMBEDDING_MODELAmazon Bedrock model for embeddingsamazon.titan-embed-text-v2:0

Note: This tool requires AWS account credentials to generate embeddings using Amazon Bedrock Titan models.

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!

Stay in touch with the team

Come meet the Strands team and other users on Discord

License

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

Security

The tools in this repository are experimental and are provided as-is. Any production use should be preceded by an independent security review of the specific tools you enable.

For guidance on building and deploying agents safely, see Responsible AI in the Strands Agents documentation.

To report a security issue, 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 versionsStrands Discord

DocumentationSamplesPython SDKToolsAgent BuilderMCP Server

Strands Agents Tools is a community-driven project that 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, Amazon Bedrock Knowledge Bases, Elasticsearch, and MongoDB Atlas
  • 🕸️ Web Infrastructure - Perform web searches, extract page content, and crawl websites with Tavily and Exa-powered tools
  • 🌐 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
  • 🤖 Agent as Tool - Create nested agent instances with model switching support for multi-model workflows and specialized sub-tasks
  • 🔗 Multi-Agent Graph - Create and manage deterministic DAG-based multi-agent pipelines with output propagation and per-node model configuration
  • 🔌 Dynamic MCP Client - ⚠️ Dynamically connect to external MCP servers and load remote tools (use with caution - see security warnings)
  • 🔄 Multiple Tools per Turn - Call several other tools from one model response with Batch Tool
  • 🔍 Browser Tool - Tool giving an agent access to perform automated actions on a browser (chromium)
  • 📈 Diagram - Create AWS cloud diagrams, basic diagrams, or UML diagrams using python libraries
  • 📰 RSS Feed Manager - Subscribe, fetch, and process RSS feeds with content filtering and persistent storage
  • 🖱️ Computer Tool - Automate desktop actions including mouse movements, keyboard input, screenshots, and application management

Important

The tools in this repository are experimental. Many of them grant agents powerful capabilities — executing code, accessing the file system, calling AWS APIs, connecting to external servers, and automating browsers and desktops — which carry real security implications. Any production use should be preceded by your own independent security review; see the Responsible AI guidance for best practices. Use of these tools is at your own risk.

📦 Installation

Quick Install

pip install strands-agents-tools

To install the dependencies for optional tools:

pip install "strands-agents-tools[mem0_memory, use_browser, rss, use_computer]"

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
editor ⚠️agent.tool.editor(command="view", path="path/to/file.py")Advanced file operations like syntax highlighting, pattern replacement, and multi-file edits
Deprecated — see Deprecations
shell* ⚠️agent.tool.shell(command="ls -la")Executing shell commands, interacting with the operating system, running scripts
Deprecated — see Deprecations
http_requestagent.tool.http_request(method="GET", url="https://api.example.com/data")Making API calls, fetching web data, sending data to external services
tavily_searchagent.tool.tavily_search(query="What is artificial intelligence?", search_depth="advanced")Real-time web search optimized for AI agents with a variety of custom parameters
tavily_extractagent.tool.tavily_extract(urls=["www.tavily.com"], extract_depth="advanced")Extract clean, structured content from web pages with advanced processing and noise removal
tavily_crawlagent.tool.tavily_crawl(url="www.tavily.com", max_depth=2, instructions="Find API docs")Crawl websites intelligently starting from a base URL with filtering and extraction
tavily_mapagent.tool.tavily_map(url="www.tavily.com", max_depth=2, instructions="Find all pages")Map website structure and discover URLs starting from a base URL without content extraction
exa_searchagent.tool.exa_search(query="Best project management tools", text=True)Intelligent web search with auto mode (default) for optimal results, plus fast and deep search modes
exa_get_contentsagent.tool.exa_get_contents(urls=["https://example.com/article"], text=True, summary={"query": "key points"})Extract full content and summaries from specific URLs with live crawling fallback
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
calculator ⚠️agent.tool.calculator(expression="2 * sin(pi/4) + log(e**2)")Performing mathematical operations, symbolic math, equation solving
Deprecated — see Deprecations
code_interpretercode_interpreter = AgentCoreCodeInterpreter(region="us-west-2"); agent = Agent(tools=[code_interpreter.code_interpreter])Execute code in isolated sandbox environments with multi-language support (Python, JavaScript, TypeScript), persistent sessions, and file operations
use_awsagent.tool.use_aws(service_name="s3", operation_name="list_buckets", parameters={}, region="us-west-2")Interacting with AWS services, cloud resource management
retrieve ⚠️agent.tool.retrieve(text="What is STRANDS?")Retrieving information from Amazon Bedrock Knowledge Bases with optional metadata
Deprecated — see Deprecations
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
agent_core_memoryagent.tool.agent_core_memory(action="record", content="Hello, I like vegetarian food")Store and retrieve memories with Amazon Bedrock Agent Core Memory service
mem0_memoryagent.tool.mem0_memory(action="store", content="Remember I like to play tennis")Store user and agent memories across agent runs to provide personalized experience (tenant identity configured via Mem0MemoryTool or environment variables)
bright_dataagent.tool.bright_data(action="scrape_as_markdown", url="https://example.com")Web scraping, search queries, screenshot capture, and structured data extraction from websites and different data feeds
memory ⚠️agent.tool.memory(action="retrieve", query="product features")Store, retrieve, list, and manage documents in Amazon Bedrock Knowledge Bases with configurable parameters via environment variables
Deprecated — see Deprecations
environment ⚠️agent.tool.environment(action="list", prefix="AWS_")Managing environment variables, configuration management
Deprecated — see Deprecations
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
think ⚠️agent.tool.think(thought="Complex problem to analyze", cycle_count=3)Advanced reasoning, multi-step thinking processes
Deprecated — see Deprecations
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_time ⚠️agent.tool.current_time(timezone="US/Pacific")Get the current time in ISO 8601 format for a specified timezone
Deprecated — see Deprecations
sleep ⚠️agent.tool.sleep(seconds=5)Pause execution for the specified number of seconds, interruptible with SIGINT (Ctrl+C)
Deprecated — see Deprecations
agent_graphagent.tool.agent_graph(agents=["agent1", "agent2"], connections=[{"from": "agent1", "to": "agent2"}])Create and visualize agent relationship graphs for complex multi-agent systems
graphagent.tool.graph(action="create", graph_id="pipeline", topology={"nodes": [...], "edges": [...]})Create and manage deterministic DAG-based multi-agent graphs using Strands SDK Graph implementation with per-node model configuration
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
Deprecated — see Deprecations
slack ⚠️agent.tool.slack(action="post_message", channel="general", text="Hello team!")Interact with Slack workspace for messaging and monitoring
Deprecated — see Deprecations
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
use_agentagent.tool.use_agent(prompt="Analyze this code", system_prompt="You are a code analyst.", model_provider="bedrock")Create nested agent instances with model switching, multi-model workflows, cost optimization, and specialized sub-tasks
workflowagent.tool.workflow(action="create", name="data_pipeline", steps=[{"tool": "file_read"}, {"tool": "python_repl"}])Define, execute, and manage multi-step automated workflows
mcp_clientagent.tool.mcp_client(action="connect", connection_id="my_server", transport="stdio", command="python", args=["server.py"])⚠️SECURITY WARNING: Dynamically connect to external MCP servers via stdio, sse, or streamable_http, list tools, and call remote tools. This can pose security risks as agents may connect to malicious servers. Use with caution in production.
batch ⚠️agent.tool.batch(invocations=[{"name": "current_time", "arguments": {"timezone": "Europe/London"}}, {"name": "stop", "arguments": {}}])Call multiple other tools from one request.
Deprecated — see Deprecations
browserbrowser = LocalChromiumBrowser(); agent = Agent(tools=[browser.browser])Web scraping, automated testing, form filling, web automation tasks
diagram ⚠️agent.tool.diagram(diagram_type="cloud", nodes=[{"id": "s3", "type": "S3"}], edges=[])Create AWS cloud architecture diagrams, network diagrams, graphs, and UML diagrams (all 14 types)
Deprecated — see Deprecations
rss ⚠️agent.tool.rss(action="subscribe", url="https://example.com/feed.xml", feed_id="tech_news")Manage RSS feeds: subscribe, fetch, read, search, and update content from various sources
Deprecated — see Deprecations
use_computeragent.tool.use_computer(action="click", x=100, y=200, app_name="Chrome") Desktop automation, GUI interaction, screen capture
search_videoagent.tool.search_video(query="people discussing AI")Semantic video search using TwelveLabs' Marengo model
chat_videoagent.tool.chat_video(prompt="What are the main topics?", video_id="video_123")Interactive video analysis using TwelveLabs' Pegasus model
mongodb_memoryagent.tool.mongodb_memory(action="record", content="User prefers vegetarian pizza")Store and retrieve memories using MongoDB Atlas with semantic search via AWS Bedrock Titan embeddings (connection and namespace configured via MongoDBMemoryTool or environment variables)
elasticsearch_memoryagent.tool.elasticsearch_memory(action="record", content="User prefers dark mode")Store and retrieve memories using Elasticsearch with semantic search via AWS Bedrock Titan embeddings (connection and namespace configured via ElasticsearchMemoryTool or environment variables)

* These tools do not work on Windows

Deprecations

The tools below are deprecated, and each row points to where that capability now lives.

When this package started, the SDK had no built-in way to do most of these things, so we shipped tools to fill the gap. Much of that is now native: the SDK reasons, injects context, manages memory, and runs tools concurrently on its own, and where a vendor maintains an official MCP server, that server will always track their API better than a wrapper here can. Keeping a second implementation alongside means two things to fix and two things to drift, so we would rather point you at the one that gets the attention.

More tools will follow as their capabilities land elsewhere, and this repository will eventually be archived. Nothing breaks suddenly — but migrating when a tool is first deprecated is easier than moving several at once later.

Deprecated tools keep working. Each one logs a warning when invoked starting in v0.8.6, and that warning becomes an error log in v0.9.0 — a louder signal for anyone who has not migrated, not a behavior change.

They are also marked with @typing_extensions.deprecated, so type checkers and IDEs flag usage before you run anything. To list what you still need to migrate, run mypy --enable-error-code deprecated over your project: it reports the from strands_tools import ... line for each deprecated tool, without invoking any of them. Prefer mypy here: pyright, with reportDeprecated enabled, reports direct calls such as calculator(expression=...) but not agent.tool.calculator(...), and it reaches the import line for only the three tools whose marker is not wrapped by @tool. Note that Python suppresses the resulting DeprecationWarning at runtime when the agent invokes a tool, which is why the log message exists as well.

ToolSuggested alternativeWarningError log
sleepfrom strands.vended_tools import sleepv0.8.6v0.9.0
editorfrom strands.vended_tools import file_editorv0.8.6v0.9.0
shellfrom strands.vended_tools import bashv0.8.6v0.9.0
batchnone needed — concurrent tool execution is the SDK default (docs)v0.8.6v0.9.0
thinknative extended thinking via model reasoning config (docs)v0.8.6v0.9.0
current_timeContextInjector (docs)v0.8.6v0.9.0
memoryMemoryManager + BedrockKnowledgeBaseStore (docs)v0.8.6v0.9.0
retrieveMemoryManager + BedrockKnowledgeBaseStore(writable=False) (docs)v0.8.6v0.9.0
calculatorfrom strands.vended_tools import bash (run python3 -c with sympy)v0.8.6v0.9.0
cronfrom strands.vended_tools import bash (manage crontab), or Amazon EventBridge Schedulerv0.8.6v0.9.0
environmentfrom strands.vended_tools import bash (inspect only, see notes)v0.8.6v0.9.0
slackofficial Slack MCP server; slack_bolt for Socket Modev0.8.6v0.9.0
diagramno replacement — have the model write graphviz/mermaid/diagrams code directlyv0.8.6v0.9.0
rssno replacement — parse feeds directly with feedparserv0.8.6v0.9.0
# BeforefromstrandsimportAgentfromstrands_toolsimporteditor, shell, sleepagent=Agent(tools=[editor, shell, sleep])
# AfterfromstrandsimportAgentfromstrands.vended_toolsimportbash, file_editor, sleepagent=Agent(tools=[bash, file_editor, sleep])

Behavior differences

The replacements are not drop-in equivalents. Check these before migrating:

  • shellbash: the SDK tool routes commands through the agent's configured sandbox and is stateless — each call runs in a fresh shell, so variables and the working directory do not persist between calls. It does not provide PTY support or batched parallel/sequential command execution.
  • editorfile_editor: supports view, create, str_replace, and insert. The pattern_replace, find_line, and undo_edit commands have no SDK equivalent.
  • sleepsleep: the maximum duration is set with make_sleep(max_duration=...) and defaults to 60 seconds, replacing the MAX_SLEEP_SECONDS environment variable which defaulted to 300 seconds.
  • batch — you can drop it. The SDK runs tool calls concurrently by default via ConcurrentToolExecutor, which also keeps tracing, metrics, and hooks intact. See Tool executors.
  • think → extended thinking — reasoning is now a model capability rather than a tool, so you configure it once instead of prompting for it. It is single-pass, so if you were relying on cycle_count to refine across passes, or on tool calls inside the reasoning loop, that pattern moves into your own orchestration. Config is per provider — see Amazon Bedrock.
  • current_timeContextInjector — the date is context, not something the agent should have to ask for, so injecting it means it is always fresh and the model cannot forget to call it. The trade-off is that your code picks the timezone; if you need the model to choose one per call, the official MCP time server still does that. See ContextInjector.
  • memory / retrieve → memory stores — memory is a first-class SDK concept now, so stores plug into the agent and inject context automatically instead of waiting to be called. store/retrieve become add/search. list, get, and delete are not part of the store protocol, so keep them as backend-native tools via get_tools(). One thing to know: the store returns relevance scores but does not filter on them, so if you relied on retrieve's default score >= 0.4 floor, apply it yourself. See Bedrock Knowledge Base store and Custom stores.
  • calculatorshell — run python3 -c with sympy for the same symbolic math. Worth being explicit: shell runs whatever it is given, whereas this tool checked expressions against an allowlist first. If you are evaluating untrusted input, put a sandbox behind the shell tool or keep your own validation in front of it.
  • cronshellcrontab through the shell tool covers scheduling on a host. Two things to plan for: the shell is sandbox-routed, so under Docker or SSH your jobs land in an environment that may not have a cron daemon, and you will be composing crontab lines yourself rather than using structured list/add/remove/edit actions. For scheduling that outlives the host, Amazon EventBridge Scheduler is usually the better fit.
  • environmentshellenv and printenv cover reading. Setting is genuinely different: a child shell cannot change the agent's own process environment, so variables need to be set where the agent is launched, or passed per call. If you were leaning on PROTECTED_VARS or secret masking, that guarding moves to your side.
  • slack → Slack's official MCP server — Slack maintains it, so it tracks their API directly, and it uses OAuth rather than long-lived tokens. It exposes a curated tool set rather than this tool's passthrough to any Web API method, and being request/response it does not cover Socket Mode or real-time events — slack_bolt remains the right tool for event listeners. Endpoint and setup: docs.slack.dev/ai/mcp-server.
  • diagram — no direct replacement, and that is deliberate: this tool was a wrapper over graphviz and the diagrams package, and a capable model writes that code well on its own. The wrapper mostly added a layer to keep in sync.
  • rss — no direct replacement. Fetching and parsing a feed is a few lines of feedparser, and the subscription list was a JSON file. If you were using feed HTTP Basic auth or the stored subscriptions, those move into your code.

💻 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")

Dynamic MCP Client Integration

⚠️SECURITY WARNING: The Dynamic MCP Client allows agents to autonomously connect to external MCP servers and load remote tools at runtime. This poses significant security risks as agents can potentially connect to malicious servers and execute untrusted code. Use with extreme caution in production environments.

This tool is different from the static MCP server implementation in the Strands SDK (see MCP Tools Documentation) which uses pre-configured, trusted MCP servers.

fromstrandsimportAgentfromstrands_toolsimportmcp_clientagent=Agent(tools=[mcp_client])
# Connect to a custom MCP server via stdioagent.tool.mcp_client(
action="connect",
connection_id="my_tools",
transport="stdio",
command="python",
args=["my_mcp_server.py"]
)
# List available tools on the servertools=agent.tool.mcp_client(
action="list_tools",
connection_id="my_tools"
)
# Call a tool from the MCP serverresult=agent.tool.mcp_client(
action="call_tool",
connection_id="my_tools",
tool_name="calculate",
tool_args={"x": 10, "y": 20}
)
# Connect to a SSE-based serveragent.tool.mcp_client(
action="connect",
connection_id="web_server",
transport="sse",
server_url="http://localhost:8080/sse"
)
# Connect to a streamable HTTP serveragent.tool.mcp_client(
action="connect",
connection_id="http_server",
transport="streamable_http",
server_url="https://api.example.com/mcp",
headers={"Authorization": "Bearer token"},
timeout=60
)
# Load MCP tools into agent's registry for direct access# ⚠️ WARNING: This loads external tools directly into the agentagent.tool.mcp_client(
action="load_tools",
connection_id="my_tools"
)
# Now you can call MCP tools directly as: agent.tool.calculate(x=10, y=20)

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
)

Tavily Search, Extract, Crawl, and Map

fromstrandsimportAgentfromstrands_tools.tavilyimport (
tavily_search, tavily_extract, tavily_crawl, tavily_map
)
# For async usage, call the corresponding *_async function with await.# Synchronous usage agent=Agent(tools=[tavily_search, tavily_extract, tavily_crawl, tavily_map])
# Real-time web searchresult=agent.tool.tavily_search(
query="Latest developments in renewable energy",
search_depth="advanced",
topic="news",
max_results=10,
include_raw_content=True
)
# Extract content from multiple URLsresult=agent.tool.tavily_extract(
urls=["www.tavily.com", "www.apple.com"],
extract_depth="advanced",
format="markdown"
)
# Advanced crawl with instructions and filteringresult=agent.tool.tavily_crawl(
url="www.tavily.com",
max_depth=2,
limit=50,
instructions="Find all API documentation and developer guides",
extract_depth="advanced",
include_images=True
)
# Basic website mappingresult=agent.tool.tavily_map(url="www.tavily.com")

Exa Search and Contents

fromstrandsimportAgentfromstrands_tools.exaimportexa_search, exa_get_contentsagent=Agent(tools=[exa_search, exa_get_contents])
# Basic search (auto mode is default and recommended)result=agent.tool.exa_search(
query="Best project management software",
text=True
)
# Company-specific search when neededresult=agent.tool.exa_search(
query="Anthropic AI safety research",
category="company",
include_domains=["anthropic.com"],
num_results=5,
summary={"query": "key research areas and findings"}
)
# News search with date filteringresult=agent.tool.exa_search(
query="AI regulation policy updates",
category="news",
start_published_date="2024-01-01T00:00:00.000Z",
text=True
)
# Get detailed content from specific URLsresult=agent.tool.exa_get_contents(
urls=[
"https://example.com/blog-post",
"https://github.com/microsoft/semantic-kernel"
],
text={"maxCharacters": 5000, "includeHtmlTags": False},
summary={
"query": "main points and practical applications"
},
subpages=2,
extras={"links": 5, "imageLinks": 2}
)
# Structured summary with JSON schemaresult=agent.tool.exa_get_contents(
urls=["https://example.com/article"],
summary={
"query": "main findings and recommendations",
"schema": {
"type": "object",
"properties": {
"main_points": {"type": "string", "description": "Key points from the article"},
"recommendations": {"type": "string", "description": "Suggested actions or advice"},
"conclusion": {"type": "string", "description": "Overall conclusion"},
"relevance": {"type": "string", "description": "Why this matters"}
},
"required": ["main_points", "conclusion"]
}
}
)

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()""")

Code Interpreter

fromstrandsimportAgentfromstrands_tools.code_interpreterimportAgentCoreCodeInterpreter# Create the code interpreter toolbedrock_agent_core_code_interpreter=AgentCoreCodeInterpreter(region="us-west-2")
agent=Agent(tools=[bedrock_agent_core_code_interpreter.code_interpreter])
# Create a sessionagent.tool.code_interpreter({
"action": {
"type": "initSession",
"description": "Data analysis session",
"session_name": "analysis-session"
}
})
# Execute Python codeagent.tool.code_interpreter({
"action": {
"type": "executeCode",
"session_name": "analysis-session",
"code": "print('Hello from sandbox!')",
"language": "python"
}
})

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"
)

Retrieve Tool

fromstrandsimportAgentfromstrands_toolsimportretrieveagent=Agent(tools=[retrieve])
# Basic retrieval without metadataresult=agent.tool.retrieve(
text="What is artificial intelligence?"
)
# Retrieval with metadata enabledresult=agent.tool.retrieve(
text="What are the latest developments in machine learning?",
enableMetadata=True
)
# Using environment variable to set default metadata behavior# Set RETRIEVE_ENABLE_METADATA_DEFAULT=true in your environmentresult=agent.tool.retrieve(
text="Tell me about cloud computing"# enableMetadata will default to the environment variable value
)

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"
}
},
]
)

Video Tools

fromstrandsimportAgentfromstrands_toolsimportsearch_video, chat_videoagent=Agent(tools=[search_video, chat_video])
# Search for video content using natural languageresult=agent.tool.search_video(
query="people discussing AI technology",
threshold="high",
group_by="video",
page_limit=5
)
# Chat with existing video (no index_id needed)result=agent.tool.chat_video(
prompt="What are the main topics discussed in this video?",
video_id="existing-video-id"
)
# Chat with new video file (index_id required for upload)result=agent.tool.chat_video(
prompt="Describe what happens in this video",
video_path="/path/to/video.mp4",
index_id="your-index-id"# or set TWELVELABS_PEGASUS_INDEX_ID env var
)

AgentCore Memory

fromstrandsimportAgentfromstrands_tools.agent_core_memoryimportAgentCoreMemoryToolProviderprovider=AgentCoreMemoryToolProvider(
memory_id="memory-123abc", # Requiredactor_id="user-456", # Requiredsession_id="session-789", # Requirednamespace="default", # Requiredregion="us-west-2"# Optional, defaults to us-west-2
)
agent=Agent(tools=provider.tools)
# Create a new memoryresult=agent.tool.agent_core_memory(
action="record",
content="I am allergic to shellfish"
)
# Search for relevant memoriesresult=agent.tool.agent_core_memory(
action="retrieve",
query="user preferences"
)
# List all memoriesresult=agent.tool.agent_core_memory(
action="list"
)
# Get a specific memory by IDresult=agent.tool.agent_core_memory(
action="get",
memory_record_id="mr-12345"
)

Browser

fromstrandsimportAgentfromstrands_tools.browserimportLocalChromiumBrowser# Create browser toolbrowser=LocalChromiumBrowser()
agent=Agent(tools=[browser.browser])
# Simple navigationresult=agent.tool.browser({
"action": {
"type": "navigate",
"url": "https://example.com"
}
})
# Initialize a session firstresult=agent.tool.browser({
"action": {
"type": "initSession",
"session_name": "main-session",
"description": "Web automation session"
}
})

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
)

Use Agent (Agent as Tool)

fromstrandsimportAgentfromstrands_toolsimportuse_agentagent=Agent(tools=[use_agent])
# Basic usage - inherits parent agent's modelresult=agent.tool.use_agent(
prompt="Tell me about the advantages of tool-building in AI agents",
system_prompt="You are a helpful AI assistant specializing in AI development concepts."
)
# Use a different model provider for specialized tasksresult=agent.tool.use_agent(
prompt="Calculate 2 + 2 and explain the result",
system_prompt="You are a helpful math assistant.",
model_provider="bedrock",
model_settings={
"model_id": "us.anthropic.claude-sonnet-4-20250514-v1:0"
},
tools=["calculator"]
)
# Use environment variables to determine modelimportosos.environ["STRANDS_PROVIDER"] ="ollama"os.environ["STRANDS_MODEL_ID"] ="qwen3:4b"result=agent.tool.use_agent(
prompt="Analyze this code",
system_prompt="You are a code review assistant.",
model_provider="env"
)
# Custom model configuration with specific parametersresult=agent.tool.use_agent(
prompt="Write a creative story",
system_prompt="You are a creative writing assistant.",
model_provider="github",
model_settings={
"model_id": "openai/o4-mini",
"params": {"temperature": 1, "max_tokens": 4000}
}
)

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

Diagram

fromstrandsimportAgentfromstrands_toolsimportdiagramagent=Agent(tools=[diagram])
# Create an AWS cloud architecture diagramresult=agent.tool.diagram(
diagram_type="cloud",
nodes=[
{"id": "users", "type": "Users", "label": "End Users"},
{"id": "cloudfront", "type": "CloudFront", "label": "CDN"},
{"id": "s3", "type": "S3", "label": "Static Assets"},
{"id": "api", "type": "APIGateway", "label": "API Gateway"},
{"id": "lambda", "type": "Lambda", "label": "Backend Service"}
],
edges=[
{"from": "users", "to": "cloudfront"},
{"from": "cloudfront", "to": "s3"},
{"from": "users", "to": "api"},
{"from": "api", "to": "lambda"}
],
title="Web Application Architecture"
)
# Create a UML class diagramresult=agent.tool.diagram(
diagram_type="class",
elements=[
{
"name": "User",
"attributes": ["+id: int", "-name: string", "#email: string"],
"methods": ["+login(): bool", "+logout(): void"]
},
{
"name": "Order",
"attributes": ["+id: int", "-items: List", "-total: float"],
"methods": ["+addItem(item): void", "+calculateTotal(): float"]
}
],
relationships=[
{"from": "User", "to": "Order", "type": "association", "multiplicity": "1..*"}
],
title="E-commerce Domain Model"
)

RSS Feed Management

fromstrandsimportAgentfromstrands_toolsimportrssagent=Agent(tools=[rss])
# Subscribe to a feedresult=agent.tool.rss(
action="subscribe",
url="https://news.example.com/rss/technology"
)
# List all subscribed feedsfeeds=agent.tool.rss(action="list")
# Read entries from a specific feedentries=agent.tool.rss(
action="read",
feed_id="news_example_com_technology",
max_entries=5,
include_content=True
)
# Search across all feedssearch_results=agent.tool.rss(
action="search",
query="machine learning",
max_entries=10
)
# Fetch feed content without subscribinglatest_news=agent.tool.rss(
action="fetch",
url="https://blog.example.org/feed",
max_entries=3
)

Use Computer

fromstrandsimportAgentfromstrands_toolsimportuse_computeragent=Agent(tools=[use_computer])
# Find mouse positionresult=agent.tool.use_computer(action="mouse_position")
# Automate adding textresult=agent.tool.use_computer(action="type", text="Hello, world!", app_name="Notepad")
# Analyze current computer screenresult=agent.tool.use_computer(action="analyze_screen")
result=agent.tool.use_computer(action="open_app", app_name="Calculator")
result=agent.tool.use_computer(action="close_app", app_name="Calendar")
result=agent.tool.use_computer(
action="hotkey",
hotkey_str="command+ctrl+f", # For macOSapp_name="Chrome"
)

Graph (Multi-Agent DAG)

Create deterministic DAG-based multi-agent pipelines where agents are nodes with dependency relationships. Unlike agent_graph (which uses persistent message-passing), graph uses task-based execution with output propagation.

fromstrandsimportAgentfromstrands_tools.graphimportgraphagent=Agent(tools=[graph])
# Create a multi-agent research pipelineresult=agent.tool.graph(
action="create",
graph_id="research_pipeline",
topology={
"nodes": [
{
"id": "researcher",
"role": "researcher",
"system_prompt": "You research topics thoroughly.",
"model_provider": "bedrock",
"model_settings": {"model_id": "us.anthropic.claude-sonnet-4-20250514-v1:0"}
},
{
"id": "analyst",
"role": "analyst",
"system_prompt": "You analyze research data.",
"model_provider": "bedrock",
"model_settings": {"model_id": "us.anthropic.claude-3-5-haiku-20241022-v1:0"}
},
{
"id": "reporter",
"role": "reporter",
"system_prompt": "You create comprehensive reports.",
"tools": ["file_write", "editor"]
}
],
"edges": [
{"from": "researcher", "to": "analyst"},
{"from": "analyst", "to": "reporter"}
],
"entry_points": ["researcher"]
}
)
# Execute a task through the graphresult=agent.tool.graph(
action="execute",
graph_id="research_pipeline",
task="Research and analyze the impact of AI on healthcare"
)
# Get graph statusresult=agent.tool.graph(action="status", graph_id="research_pipeline")
# List all graphsresult=agent.tool.graph(action="list")
# Delete a graphresult=agent.tool.graph(action="delete", graph_id="research_pipeline")

Elasticsearch Memory

Note: This tool requires AWS account credentials to generate embeddings using Amazon Bedrock Titan models.

fromstrandsimportAgentfromstrands_tools.elasticsearch_memoryimportElasticsearchMemoryTool, elasticsearch_memory# Bind connection, index, and namespace per principal (kept out of the agent-facing tool)memory_tool=ElasticsearchMemoryTool(
cloud_id="your-elasticsearch-cloud-id", # or es_url="https://...:443" for Serverlessapi_key="your-api-key",
index_name="memories",
namespace="user_123",
)
agent=Agent(tools=[memory_tool.elasticsearch_memory])
# Store a memory with semantic embeddingsresult=agent.tool.elasticsearch_memory(
action="record",
content="User prefers vegetarian pizza with extra cheese",
metadata={"category": "food_preferences", "type": "dietary"},
)
# Search memories using semantic similarity (vector search)result=agent.tool.elasticsearch_memory(
action="retrieve",
query="food preferences and dietary restrictions",
max_results=5,
)
# List all memories with paginationresult=agent.tool.elasticsearch_memory(action="list", max_results=10)
# Get specific memory by IDresult=agent.tool.elasticsearch_memory(action="get", memory_id="mem_1234567890_abcd1234")
# Delete a memoryresult=agent.tool.elasticsearch_memory(action="delete", memory_id="mem_1234567890_abcd1234")
# Single-tenant: use the standalone tool with configuration from environment variablesagent=Agent(tools=[elasticsearch_memory])
result=agent.tool.elasticsearch_memory(action="record", content="User prefers vegetarian pizza")

MongoDB Atlas Memory

Note: This tool requires AWS account credentials to generate embeddings using Amazon Bedrock Titan models.

fromstrandsimportAgentfromstrands_tools.mongodb_memoryimportMongoDBMemoryTool, mongodb_memory# Bind connection, collection, and namespace per principal (kept out of the agent-facing tool)memory_tool=MongoDBMemoryTool(
cluster_uri="mongodb+srv://username:password@cluster0.mongodb.net/?retryWrites=true&w=majority",
database_name="memories",
collection_name="user_memories",
namespace="user_123",
)
agent=Agent(tools=[memory_tool.mongodb_memory])
# Store a memory with semantic embeddingsresult=agent.tool.mongodb_memory(
action="record",
content="User prefers vegetarian pizza with extra cheese",
metadata={"category": "food_preferences", "type": "dietary"},
)
# Search memories using semantic similarity (vector search)result=agent.tool.mongodb_memory(
action="retrieve",
query="food preferences and dietary restrictions",
max_results=5,
)
# List all memories with paginationresult=agent.tool.mongodb_memory(action="list", max_results=10)
# Get specific memory by IDresult=agent.tool.mongodb_memory(action="get", memory_id="mem_1234567890_abcd1234")
# Delete a memoryresult=agent.tool.mongodb_memory(action="delete", memory_id="mem_1234567890_abcd1234")
# Single-tenant: use the standalone tool with configuration from environment variablesagent=Agent(tools=[mongodb_memory])
result=agent.tool.mongodb_memory(action="record", content="User prefers vegetarian pizza")

🌍 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_NON_INTERACTIVERun tools without interactive prompts, set to "true" to suppress confirmation dialogsfalseTools with a confirmation prompt (e.g. shell, 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

Tavily Search, Extract, Crawl, and Map Tools

Environment VariableDescriptionDefault
TAVILY_API_KEYTavily API key (required for all Tavily functionality)None

Exa Search and Contents Tools

Environment VariableDescriptionDefault
EXA_API_KEYExa API key (required for all Exa functionality)None

Mem0 Memory Tool

Security Model: The tenant-isolation keys (user_id / agent_id) are never exposed as agent-facing tool parameters. The agent only chooses the action and its content/query/memory_id. This prevents a model (or prompt-injected content) from reading, writing, or deleting another tenant's memories.

Usage patterns:

fromstrandsimportAgentfromstrands_tools.mem0_memoryimportMem0MemoryTool, mem0_memory# Multi-tenant (recommended): bind identity per authenticated principaltool=Mem0MemoryTool(user_id=f"user_{authenticated_user_id}")
agent=Agent(tools=[tool.mem0_memory])
agent.tool.mem0_memory(action="store", content="User prefers vegetarian pizza")
# Single-tenant: use the standalone function with env vars (MEM0_USER_ID / MEM0_AGENT_ID)agent=Agent(tools=[mem0_memory])
agent.tool.mem0_memory(action="store", content="User prefers vegetarian pizza")

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
  4. Neptune Analytics (Optional Graph backend for search enhancement):

    • Uses Neptune Analytics as the graph store backend to enhance memory recall.
    • Requires AWS credentials and Neptune Analytics configuration
    # Configure your Neptune Analytics graph ID in the .env file:
    export NEPTUNE_ANALYTICS_GRAPH_IDENTIFIER=sample-graph-id
    # Configure your Neptune Analytics graph ID in Python code:
    import os
    os.environ['NEPTUNE_ANALYTICS_GRAPH_IDENTIFIER'] = "g-sample-graph-id"
    
Environment VariableDescriptionDefaultRequired For
MEM0_USER_IDUser ID for memory operations (standalone function)NoneStandalone
MEM0_AGENT_IDAgent ID for memory operations (standalone function)NoneStandalone
MEM0_API_KEYMem0 Platform API keyNoneMem0 Platform
OPENSEARCH_HOSTOpenSearch Host URLNoneOpenSearch
AWS_REGIONAWS Region for OpenSearchus-west-2OpenSearch
NEPTUNE_ANALYTICS_GRAPH_IDENTIFIERNeptune Analytics Graph IdentifierNoneNeptune Analytics
DEVEnable development mode (bypasses confirmations)falseAll modes
MEM0_LLM_PROVIDERLLM provider for memory processingaws_bedrockAll modes
MEM0_LLM_MODELLLM model for memory processinganthropic.claude-3-5-haiku-20241022-v1:0All modes
MEM0_LLM_TEMPERATURELLM temperature (0.0-2.0)0.1All modes
MEM0_LLM_MAX_TOKENSLLM maximum tokens2000All modes
MEM0_EMBEDDER_PROVIDEREmbedder provider for vector embeddingsaws_bedrockAll modes
MEM0_EMBEDDER_MODELEmbedder model for vector embeddingsamazon.titan-embed-text-v2:0All 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)
  • If NEPTUNE_ANALYTICS_GRAPH_IDENTIFIER is set, the tool will configure Neptune Analytics as graph store to enhance memory search
  • LLM configuration applies to all backend modes and allows customization of the language model used for memory processing

Bright Data Tool

Environment VariableDescriptionDefault
BRIGHTDATA_API_KEYBright Data API KeyNone
BRIGHTDATA_ZONEBright Data Web Unlocker Zoneweb_unlocker1

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
PYTHON_REPL_INTERACTIVEWhether to enable interactive PTY modeNone
PYTHON_REPL_RESET_STATEWhether to reset the REPL state before executionNone
PYTHON_REPL_PERSISTENCE_DIRSet Directory for python_repl tool to write state fileNone

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
EDITOR_DISABLE_BACKUPSkip creating .bak backup files during edit operationsfalse

Environment Tool

Environment VariableDescriptionDefault
ENV_VARS_MASKED_DEFAULTMasking of values whose name contains TOKEN, SECRET, PASSWORD, KEY, or AUTH. Set to false to disable. This is the only way to configure masking: the agent cannot override it through tool input, and the environment tool cannot set it. Tools that execute arbitrary code in the agent process, such as python_repl and shell, can still write ittrue

HTTP Request Tool

Environment VariableDescriptionDefault
STRANDS_HTTP_ALLOW_INSECURE_SSLAllow disabling SSL certificate verification via verify_ssl parameterfalse

Dynamic MCP Client Tool

Environment VariableDescriptionDefault
STRANDS_MCP_TIMEOUTDefault timeout in seconds for MCP operations30.0

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

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

RSS Tool

Environment VariableDescriptionDefault
STRANDS_RSS_MAX_ENTRIESDefault setting for maximum number of entries per feed100
STRANDS_RSS_UPDATE_INTERVALDefault amount of time between updating rss feeds in minutes60
STRANDS_RSS_STORAGE_PATHDefault storage path where rss feeds are stored locallystrands_rss_feeds (this may vary based on your system)

Retrieve Tool

Environment VariableDescriptionDefault
RETRIEVE_ENABLE_METADATA_DEFAULTDefault setting for enabling metadata in retrieve tool responsesfalse

Use Agent Tool

Environment VariableDescriptionDefault
STRANDS_PROVIDERDefault model provider when using model_provider="env"ollama
STRANDS_MODEL_IDDefault model identifier for environment-based model selectionNone
STRANDS_MAX_TOKENSMaximum tokens for the nested agent modelNone
STRANDS_TEMPERATURESampling temperature for the nested agent modelNone

Elasticsearch Memory Tool

Environment VariableDescriptionDefault
ELASTICSEARCH_CLOUD_IDElasticsearch Cloud ID for connectionNone
ELASTICSEARCH_URLElasticsearch URL for serverless connectionNone
ELASTICSEARCH_API_KEYElasticsearch API key for authenticationNone
ELASTICSEARCH_INDEX_NAMEElasticsearch index name for memory storagestrands_memory
ELASTICSEARCH_NAMESPACENamespace for memory isolationdefault
ELASTICSEARCH_EMBEDDING_MODELAmazon Bedrock model for embeddingsamazon.titan-embed-text-v2:0
AWS_REGIONAWS region for Bedrock embedding serviceus-west-2

Note: This tool requires AWS account credentials to generate embeddings using Amazon Bedrock Titan models.

Graph Tool

The graph tool uses the same model provider environment variables as use_agent for per-node model configuration. No additional environment variables are required.

Video Tools

Environment VariableDescriptionDefault
TWELVELABS_API_KEYTwelveLabs API key for video analysisNone
TWELVELABS_MARENGO_INDEX_IDDefault index ID for search_video toolNone
TWELVELABS_PEGASUS_INDEX_IDDefault index ID for chat_video toolNone

MongoDB Atlas Memory Tool

Environment VariableDescriptionDefault
MONGODB_ATLAS_CLUSTER_URIMongoDB Atlas connection stringNone
MONGODB_DATABASE_NAMEDatabase name for MongoDB operationsstrands_memory
MONGODB_COLLECTION_NAMECollection name for MongoDB operationsmemories
MONGODB_NAMESPACENamespace for memory isolationdefault
MONGODB_EMBEDDING_MODELAmazon Bedrock model for embeddingsamazon.titan-embed-text-v2:0

Note: This tool requires AWS account credentials to generate embeddings using Amazon Bedrock Titan models.

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!

Stay in touch with the team

Come meet the Strands team and other users on Discord

License

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

Security

The tools in this repository are experimental and are provided as-is. Any production use should be preceded by an independent security review of the specific tools you enable.

For guidance on building and deploying agents safely, see Responsible AI in the Strands Agents documentation.

To report a security issue, 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 versionsStrands Discord

DocumentationSamplesPython SDKToolsAgent BuilderMCP Server

Strands Agents Tools is a community-driven project that 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, Amazon Bedrock Knowledge Bases, Elasticsearch, and MongoDB Atlas
  • 🕸️ Web Infrastructure - Perform web searches, extract page content, and crawl websites with Tavily and Exa-powered tools
  • 🌐 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
  • 🤖 Agent as Tool - Create nested agent instances with model switching support for multi-model workflows and specialized sub-tasks
  • 🔗 Multi-Agent Graph - Create and manage deterministic DAG-based multi-agent pipelines with output propagation and per-node model configuration
  • 🔌 Dynamic MCP Client - ⚠️ Dynamically connect to external MCP servers and load remote tools (use with caution - see security warnings)
  • 🔄 Multiple Tools per Turn - Call several other tools from one model response with Batch Tool
  • 🔍 Browser Tool - Tool giving an agent access to perform automated actions on a browser (chromium)
  • 📈 Diagram - Create AWS cloud diagrams, basic diagrams, or UML diagrams using python libraries
  • 📰 RSS Feed Manager - Subscribe, fetch, and process RSS feeds with content filtering and persistent storage
  • 🖱️ Computer Tool - Automate desktop actions including mouse movements, keyboard input, screenshots, and application management

Important

The tools in this repository are experimental. Many of them grant agents powerful capabilities — executing code, accessing the file system, calling AWS APIs, connecting to external servers, and automating browsers and desktops — which carry real security implications. Any production use should be preceded by your own independent security review; see the Responsible AI guidance for best practices. Use of these tools is at your own risk.

📦 Installation

Quick Install

pip install strands-agents-tools

To install the dependencies for optional tools:

pip install "strands-agents-tools[mem0_memory, use_browser, rss, use_computer]"

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
editor ⚠️agent.tool.editor(command="view", path="path/to/file.py")Advanced file operations like syntax highlighting, pattern replacement, and multi-file edits
Deprecated — see Deprecations
shell* ⚠️agent.tool.shell(command="ls -la")Executing shell commands, interacting with the operating system, running scripts
Deprecated — see Deprecations
http_requestagent.tool.http_request(method="GET", url="https://api.example.com/data")Making API calls, fetching web data, sending data to external services
tavily_searchagent.tool.tavily_search(query="What is artificial intelligence?", search_depth="advanced")Real-time web search optimized for AI agents with a variety of custom parameters
tavily_extractagent.tool.tavily_extract(urls=["www.tavily.com"], extract_depth="advanced")Extract clean, structured content from web pages with advanced processing and noise removal
tavily_crawlagent.tool.tavily_crawl(url="www.tavily.com", max_depth=2, instructions="Find API docs")Crawl websites intelligently starting from a base URL with filtering and extraction
tavily_mapagent.tool.tavily_map(url="www.tavily.com", max_depth=2, instructions="Find all pages")Map website structure and discover URLs starting from a base URL without content extraction
exa_searchagent.tool.exa_search(query="Best project management tools", text=True)Intelligent web search with auto mode (default) for optimal results, plus fast and deep search modes
exa_get_contentsagent.tool.exa_get_contents(urls=["https://example.com/article"], text=True, summary={"query": "key points"})Extract full content and summaries from specific URLs with live crawling fallback
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
calculator ⚠️agent.tool.calculator(expression="2 * sin(pi/4) + log(e**2)")Performing mathematical operations, symbolic math, equation solving
Deprecated — see Deprecations
code_interpretercode_interpreter = AgentCoreCodeInterpreter(region="us-west-2"); agent = Agent(tools=[code_interpreter.code_interpreter])Execute code in isolated sandbox environments with multi-language support (Python, JavaScript, TypeScript), persistent sessions, and file operations
use_awsagent.tool.use_aws(service_name="s3", operation_name="list_buckets", parameters={}, region="us-west-2")Interacting with AWS services, cloud resource management
retrieve ⚠️agent.tool.retrieve(text="What is STRANDS?")Retrieving information from Amazon Bedrock Knowledge Bases with optional metadata
Deprecated — see Deprecations
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
agent_core_memoryagent.tool.agent_core_memory(action="record", content="Hello, I like vegetarian food")Store and retrieve memories with Amazon Bedrock Agent Core Memory service
mem0_memoryagent.tool.mem0_memory(action="store", content="Remember I like to play tennis")Store user and agent memories across agent runs to provide personalized experience (tenant identity configured via Mem0MemoryTool or environment variables)
bright_dataagent.tool.bright_data(action="scrape_as_markdown", url="https://example.com")Web scraping, search queries, screenshot capture, and structured data extraction from websites and different data feeds
memory ⚠️agent.tool.memory(action="retrieve", query="product features")Store, retrieve, list, and manage documents in Amazon Bedrock Knowledge Bases with configurable parameters via environment variables
Deprecated — see Deprecations
environment ⚠️agent.tool.environment(action="list", prefix="AWS_")Managing environment variables, configuration management
Deprecated — see Deprecations
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
think ⚠️agent.tool.think(thought="Complex problem to analyze", cycle_count=3)Advanced reasoning, multi-step thinking processes
Deprecated — see Deprecations
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_time ⚠️agent.tool.current_time(timezone="US/Pacific")Get the current time in ISO 8601 format for a specified timezone
Deprecated — see Deprecations
sleep ⚠️agent.tool.sleep(seconds=5)Pause execution for the specified number of seconds, interruptible with SIGINT (Ctrl+C)
Deprecated — see Deprecations
agent_graphagent.tool.agent_graph(agents=["agent1", "agent2"], connections=[{"from": "agent1", "to": "agent2"}])Create and visualize agent relationship graphs for complex multi-agent systems
graphagent.tool.graph(action="create", graph_id="pipeline", topology={"nodes": [...], "edges": [...]})Create and manage deterministic DAG-based multi-agent graphs using Strands SDK Graph implementation with per-node model configuration
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
Deprecated — see Deprecations
slack ⚠️agent.tool.slack(action="post_message", channel="general", text="Hello team!")Interact with Slack workspace for messaging and monitoring
Deprecated — see Deprecations
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
use_agentagent.tool.use_agent(prompt="Analyze this code", system_prompt="You are a code analyst.", model_provider="bedrock")Create nested agent instances with model switching, multi-model workflows, cost optimization, and specialized sub-tasks
workflowagent.tool.workflow(action="create", name="data_pipeline", steps=[{"tool": "file_read"}, {"tool": "python_repl"}])Define, execute, and manage multi-step automated workflows
mcp_clientagent.tool.mcp_client(action="connect", connection_id="my_server", transport="stdio", command="python", args=["server.py"])⚠️SECURITY WARNING: Dynamically connect to external MCP servers via stdio, sse, or streamable_http, list tools, and call remote tools. This can pose security risks as agents may connect to malicious servers. Use with caution in production.
batch ⚠️agent.tool.batch(invocations=[{"name": "current_time", "arguments": {"timezone": "Europe/London"}}, {"name": "stop", "arguments": {}}])Call multiple other tools from one request.
Deprecated — see Deprecations
browserbrowser = LocalChromiumBrowser(); agent = Agent(tools=[browser.browser])Web scraping, automated testing, form filling, web automation tasks
diagram ⚠️agent.tool.diagram(diagram_type="cloud", nodes=[{"id": "s3", "type": "S3"}], edges=[])Create AWS cloud architecture diagrams, network diagrams, graphs, and UML diagrams (all 14 types)
Deprecated — see Deprecations
rss ⚠️agent.tool.rss(action="subscribe", url="https://example.com/feed.xml", feed_id="tech_news")Manage RSS feeds: subscribe, fetch, read, search, and update content from various sources
Deprecated — see Deprecations
use_computeragent.tool.use_computer(action="click", x=100, y=200, app_name="Chrome") Desktop automation, GUI interaction, screen capture
search_videoagent.tool.search_video(query="people discussing AI")Semantic video search using TwelveLabs' Marengo model
chat_videoagent.tool.chat_video(prompt="What are the main topics?", video_id="video_123")Interactive video analysis using TwelveLabs' Pegasus model
mongodb_memoryagent.tool.mongodb_memory(action="record", content="User prefers vegetarian pizza")Store and retrieve memories using MongoDB Atlas with semantic search via AWS Bedrock Titan embeddings (connection and namespace configured via MongoDBMemoryTool or environment variables)
elasticsearch_memoryagent.tool.elasticsearch_memory(action="record", content="User prefers dark mode")Store and retrieve memories using Elasticsearch with semantic search via AWS Bedrock Titan embeddings (connection and namespace configured via ElasticsearchMemoryTool or environment variables)

* These tools do not work on Windows

Deprecations

The tools below are deprecated, and each row points to where that capability now lives.

When this package started, the SDK had no built-in way to do most of these things, so we shipped tools to fill the gap. Much of that is now native: the SDK reasons, injects context, manages memory, and runs tools concurrently on its own, and where a vendor maintains an official MCP server, that server will always track their API better than a wrapper here can. Keeping a second implementation alongside means two things to fix and two things to drift, so we would rather point you at the one that gets the attention.

More tools will follow as their capabilities land elsewhere, and this repository will eventually be archived. Nothing breaks suddenly — but migrating when a tool is first deprecated is easier than moving several at once later.

Deprecated tools keep working. Each one logs a warning when invoked starting in v0.8.6, and that warning becomes an error log in v0.9.0 — a louder signal for anyone who has not migrated, not a behavior change.

They are also marked with @typing_extensions.deprecated, so type checkers and IDEs flag usage before you run anything. To list what you still need to migrate, run mypy --enable-error-code deprecated over your project: it reports the from strands_tools import ... line for each deprecated tool, without invoking any of them. Prefer mypy here: pyright, with reportDeprecated enabled, reports direct calls such as calculator(expression=...) but not agent.tool.calculator(...), and it reaches the import line for only the three tools whose marker is not wrapped by @tool. Note that Python suppresses the resulting DeprecationWarning at runtime when the agent invokes a tool, which is why the log message exists as well.

ToolSuggested alternativeWarningError log
sleepfrom strands.vended_tools import sleepv0.8.6v0.9.0
editorfrom strands.vended_tools import file_editorv0.8.6v0.9.0
shellfrom strands.vended_tools import bashv0.8.6v0.9.0
batchnone needed — concurrent tool execution is the SDK default (docs)v0.8.6v0.9.0
thinknative extended thinking via model reasoning config (docs)v0.8.6v0.9.0
current_timeContextInjector (docs)v0.8.6v0.9.0
memoryMemoryManager + BedrockKnowledgeBaseStore (docs)v0.8.6v0.9.0
retrieveMemoryManager + BedrockKnowledgeBaseStore(writable=False) (docs)v0.8.6v0.9.0
calculatorfrom strands.vended_tools import bash (run python3 -c with sympy)v0.8.6v0.9.0
cronfrom strands.vended_tools import bash (manage crontab), or Amazon EventBridge Schedulerv0.8.6v0.9.0
environmentfrom strands.vended_tools import bash (inspect only, see notes)v0.8.6v0.9.0
slackofficial Slack MCP server; slack_bolt for Socket Modev0.8.6v0.9.0
diagramno replacement — have the model write graphviz/mermaid/diagrams code directlyv0.8.6v0.9.0
rssno replacement — parse feeds directly with feedparserv0.8.6v0.9.0
# BeforefromstrandsimportAgentfromstrands_toolsimporteditor, shell, sleepagent=Agent(tools=[editor, shell, sleep])
# AfterfromstrandsimportAgentfromstrands.vended_toolsimportbash, file_editor, sleepagent=Agent(tools=[bash, file_editor, sleep])

Behavior differences

The replacements are not drop-in equivalents. Check these before migrating:

  • shellbash: the SDK tool routes commands through the agent's configured sandbox and is stateless — each call runs in a fresh shell, so variables and the working directory do not persist between calls. It does not provide PTY support or batched parallel/sequential command execution.
  • editorfile_editor: supports view, create, str_replace, and insert. The pattern_replace, find_line, and undo_edit commands have no SDK equivalent.
  • sleepsleep: the maximum duration is set with make_sleep(max_duration=...) and defaults to 60 seconds, replacing the MAX_SLEEP_SECONDS environment variable which defaulted to 300 seconds.
  • batch — you can drop it. The SDK runs tool calls concurrently by default via ConcurrentToolExecutor, which also keeps tracing, metrics, and hooks intact. See Tool executors.
  • think → extended thinking — reasoning is now a model capability rather than a tool, so you configure it once instead of prompting for it. It is single-pass, so if you were relying on cycle_count to refine across passes, or on tool calls inside the reasoning loop, that pattern moves into your own orchestration. Config is per provider — see Amazon Bedrock.
  • current_timeContextInjector — the date is context, not something the agent should have to ask for, so injecting it means it is always fresh and the model cannot forget to call it. The trade-off is that your code picks the timezone; if you need the model to choose one per call, the official MCP time server still does that. See ContextInjector.
  • memory / retrieve → memory stores — memory is a first-class SDK concept now, so stores plug into the agent and inject context automatically instead of waiting to be called. store/retrieve become add/search. list, get, and delete are not part of the store protocol, so keep them as backend-native tools via get_tools(). One thing to know: the store returns relevance scores but does not filter on them, so if you relied on retrieve's default score >= 0.4 floor, apply it yourself. See Bedrock Knowledge Base store and Custom stores.
  • calculatorshell — run python3 -c with sympy for the same symbolic math. Worth being explicit: shell runs whatever it is given, whereas this tool checked expressions against an allowlist first. If you are evaluating untrusted input, put a sandbox behind the shell tool or keep your own validation in front of it.
  • cronshellcrontab through the shell tool covers scheduling on a host. Two things to plan for: the shell is sandbox-routed, so under Docker or SSH your jobs land in an environment that may not have a cron daemon, and you will be composing crontab lines yourself rather than using structured list/add/remove/edit actions. For scheduling that outlives the host, Amazon EventBridge Scheduler is usually the better fit.
  • environmentshellenv and printenv cover reading. Setting is genuinely different: a child shell cannot change the agent's own process environment, so variables need to be set where the agent is launched, or passed per call. If you were leaning on PROTECTED_VARS or secret masking, that guarding moves to your side.
  • slack → Slack's official MCP server — Slack maintains it, so it tracks their API directly, and it uses OAuth rather than long-lived tokens. It exposes a curated tool set rather than this tool's passthrough to any Web API method, and being request/response it does not cover Socket Mode or real-time events — slack_bolt remains the right tool for event listeners. Endpoint and setup: docs.slack.dev/ai/mcp-server.
  • diagram — no direct replacement, and that is deliberate: this tool was a wrapper over graphviz and the diagrams package, and a capable model writes that code well on its own. The wrapper mostly added a layer to keep in sync.
  • rss — no direct replacement. Fetching and parsing a feed is a few lines of feedparser, and the subscription list was a JSON file. If you were using feed HTTP Basic auth or the stored subscriptions, those move into your code.

💻 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")

Dynamic MCP Client Integration

⚠️SECURITY WARNING: The Dynamic MCP Client allows agents to autonomously connect to external MCP servers and load remote tools at runtime. This poses significant security risks as agents can potentially connect to malicious servers and execute untrusted code. Use with extreme caution in production environments.

This tool is different from the static MCP server implementation in the Strands SDK (see MCP Tools Documentation) which uses pre-configured, trusted MCP servers.

fromstrandsimportAgentfromstrands_toolsimportmcp_clientagent=Agent(tools=[mcp_client])
# Connect to a custom MCP server via stdioagent.tool.mcp_client(
action="connect",
connection_id="my_tools",
transport="stdio",
command="python",
args=["my_mcp_server.py"]
)
# List available tools on the servertools=agent.tool.mcp_client(
action="list_tools",
connection_id="my_tools"
)
# Call a tool from the MCP serverresult=agent.tool.mcp_client(
action="call_tool",
connection_id="my_tools",
tool_name="calculate",
tool_args={"x": 10, "y": 20}
)
# Connect to a SSE-based serveragent.tool.mcp_client(
action="connect",
connection_id="web_server",
transport="sse",
server_url="http://localhost:8080/sse"
)
# Connect to a streamable HTTP serveragent.tool.mcp_client(
action="connect",
connection_id="http_server",
transport="streamable_http",
server_url="https://api.example.com/mcp",
headers={"Authorization": "Bearer token"},
timeout=60
)
# Load MCP tools into agent's registry for direct access# ⚠️ WARNING: This loads external tools directly into the agentagent.tool.mcp_client(
action="load_tools",
connection_id="my_tools"
)
# Now you can call MCP tools directly as: agent.tool.calculate(x=10, y=20)

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
)

Tavily Search, Extract, Crawl, and Map

fromstrandsimportAgentfromstrands_tools.tavilyimport (
tavily_search, tavily_extract, tavily_crawl, tavily_map
)
# For async usage, call the corresponding *_async function with await.# Synchronous usage agent=Agent(tools=[tavily_search, tavily_extract, tavily_crawl, tavily_map])
# Real-time web searchresult=agent.tool.tavily_search(
query="Latest developments in renewable energy",
search_depth="advanced",
topic="news",
max_results=10,
include_raw_content=True
)
# Extract content from multiple URLsresult=agent.tool.tavily_extract(
urls=["www.tavily.com", "www.apple.com"],
extract_depth="advanced",
format="markdown"
)
# Advanced crawl with instructions and filteringresult=agent.tool.tavily_crawl(
url="www.tavily.com",
max_depth=2,
limit=50,
instructions="Find all API documentation and developer guides",
extract_depth="advanced",
include_images=True
)
# Basic website mappingresult=agent.tool.tavily_map(url="www.tavily.com")

Exa Search and Contents

fromstrandsimportAgentfromstrands_tools.exaimportexa_search, exa_get_contentsagent=Agent(tools=[exa_search, exa_get_contents])
# Basic search (auto mode is default and recommended)result=agent.tool.exa_search(
query="Best project management software",
text=True
)
# Company-specific search when neededresult=agent.tool.exa_search(
query="Anthropic AI safety research",
category="company",
include_domains=["anthropic.com"],
num_results=5,
summary={"query": "key research areas and findings"}
)
# News search with date filteringresult=agent.tool.exa_search(
query="AI regulation policy updates",
category="news",
start_published_date="2024-01-01T00:00:00.000Z",
text=True
)
# Get detailed content from specific URLsresult=agent.tool.exa_get_contents(
urls=[
"https://example.com/blog-post",
"https://github.com/microsoft/semantic-kernel"
],
text={"maxCharacters": 5000, "includeHtmlTags": False},
summary={
"query": "main points and practical applications"
},
subpages=2,
extras={"links": 5, "imageLinks": 2}
)
# Structured summary with JSON schemaresult=agent.tool.exa_get_contents(
urls=["https://example.com/article"],
summary={
"query": "main findings and recommendations",
"schema": {
"type": "object",
"properties": {
"main_points": {"type": "string", "description": "Key points from the article"},
"recommendations": {"type": "string", "description": "Suggested actions or advice"},
"conclusion": {"type": "string", "description": "Overall conclusion"},
"relevance": {"type": "string", "description": "Why this matters"}
},
"required": ["main_points", "conclusion"]
}
}
)

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()""")

Code Interpreter

fromstrandsimportAgentfromstrands_tools.code_interpreterimportAgentCoreCodeInterpreter# Create the code interpreter toolbedrock_agent_core_code_interpreter=AgentCoreCodeInterpreter(region="us-west-2")
agent=Agent(tools=[bedrock_agent_core_code_interpreter.code_interpreter])
# Create a sessionagent.tool.code_interpreter({
"action": {
"type": "initSession",
"description": "Data analysis session",
"session_name": "analysis-session"
}
})
# Execute Python codeagent.tool.code_interpreter({
"action": {
"type": "executeCode",
"session_name": "analysis-session",
"code": "print('Hello from sandbox!')",
"language": "python"
}
})

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"
)

Retrieve Tool

fromstrandsimportAgentfromstrands_toolsimportretrieveagent=Agent(tools=[retrieve])
# Basic retrieval without metadataresult=agent.tool.retrieve(
text="What is artificial intelligence?"
)
# Retrieval with metadata enabledresult=agent.tool.retrieve(
text="What are the latest developments in machine learning?",
enableMetadata=True
)
# Using environment variable to set default metadata behavior# Set RETRIEVE_ENABLE_METADATA_DEFAULT=true in your environmentresult=agent.tool.retrieve(
text="Tell me about cloud computing"# enableMetadata will default to the environment variable value
)

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"
}
},
]
)

Video Tools

fromstrandsimportAgentfromstrands_toolsimportsearch_video, chat_videoagent=Agent(tools=[search_video, chat_video])
# Search for video content using natural languageresult=agent.tool.search_video(
query="people discussing AI technology",
threshold="high",
group_by="video",
page_limit=5
)
# Chat with existing video (no index_id needed)result=agent.tool.chat_video(
prompt="What are the main topics discussed in this video?",
video_id="existing-video-id"
)
# Chat with new video file (index_id required for upload)result=agent.tool.chat_video(
prompt="Describe what happens in this video",
video_path="/path/to/video.mp4",
index_id="your-index-id"# or set TWELVELABS_PEGASUS_INDEX_ID env var
)

AgentCore Memory

fromstrandsimportAgentfromstrands_tools.agent_core_memoryimportAgentCoreMemoryToolProviderprovider=AgentCoreMemoryToolProvider(
memory_id="memory-123abc", # Requiredactor_id="user-456", # Requiredsession_id="session-789", # Requirednamespace="default", # Requiredregion="us-west-2"# Optional, defaults to us-west-2
)
agent=Agent(tools=provider.tools)
# Create a new memoryresult=agent.tool.agent_core_memory(
action="record",
content="I am allergic to shellfish"
)
# Search for relevant memoriesresult=agent.tool.agent_core_memory(
action="retrieve",
query="user preferences"
)
# List all memoriesresult=agent.tool.agent_core_memory(
action="list"
)
# Get a specific memory by IDresult=agent.tool.agent_core_memory(
action="get",
memory_record_id="mr-12345"
)

Browser

fromstrandsimportAgentfromstrands_tools.browserimportLocalChromiumBrowser# Create browser toolbrowser=LocalChromiumBrowser()
agent=Agent(tools=[browser.browser])
# Simple navigationresult=agent.tool.browser({
"action": {
"type": "navigate",
"url": "https://example.com"
}
})
# Initialize a session firstresult=agent.tool.browser({
"action": {
"type": "initSession",
"session_name": "main-session",
"description": "Web automation session"
}
})

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
)

Use Agent (Agent as Tool)

fromstrandsimportAgentfromstrands_toolsimportuse_agentagent=Agent(tools=[use_agent])
# Basic usage - inherits parent agent's modelresult=agent.tool.use_agent(
prompt="Tell me about the advantages of tool-building in AI agents",
system_prompt="You are a helpful AI assistant specializing in AI development concepts."
)
# Use a different model provider for specialized tasksresult=agent.tool.use_agent(
prompt="Calculate 2 + 2 and explain the result",
system_prompt="You are a helpful math assistant.",
model_provider="bedrock",
model_settings={
"model_id": "us.anthropic.claude-sonnet-4-20250514-v1:0"
},
tools=["calculator"]
)
# Use environment variables to determine modelimportosos.environ["STRANDS_PROVIDER"] ="ollama"os.environ["STRANDS_MODEL_ID"] ="qwen3:4b"result=agent.tool.use_agent(
prompt="Analyze this code",
system_prompt="You are a code review assistant.",
model_provider="env"
)
# Custom model configuration with specific parametersresult=agent.tool.use_agent(
prompt="Write a creative story",
system_prompt="You are a creative writing assistant.",
model_provider="github",
model_settings={
"model_id": "openai/o4-mini",
"params": {"temperature": 1, "max_tokens": 4000}
}
)

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

Diagram

fromstrandsimportAgentfromstrands_toolsimportdiagramagent=Agent(tools=[diagram])
# Create an AWS cloud architecture diagramresult=agent.tool.diagram(
diagram_type="cloud",
nodes=[
{"id": "users", "type": "Users", "label": "End Users"},
{"id": "cloudfront", "type": "CloudFront", "label": "CDN"},
{"id": "s3", "type": "S3", "label": "Static Assets"},
{"id": "api", "type": "APIGateway", "label": "API Gateway"},
{"id": "lambda", "type": "Lambda", "label": "Backend Service"}
],
edges=[
{"from": "users", "to": "cloudfront"},
{"from": "cloudfront", "to": "s3"},
{"from": "users", "to": "api"},
{"from": "api", "to": "lambda"}
],
title="Web Application Architecture"
)
# Create a UML class diagramresult=agent.tool.diagram(
diagram_type="class",
elements=[
{
"name": "User",
"attributes": ["+id: int", "-name: string", "#email: string"],
"methods": ["+login(): bool", "+logout(): void"]
},
{
"name": "Order",
"attributes": ["+id: int", "-items: List", "-total: float"],
"methods": ["+addItem(item): void", "+calculateTotal(): float"]
}
],
relationships=[
{"from": "User", "to": "Order", "type": "association", "multiplicity": "1..*"}
],
title="E-commerce Domain Model"
)

RSS Feed Management

fromstrandsimportAgentfromstrands_toolsimportrssagent=Agent(tools=[rss])
# Subscribe to a feedresult=agent.tool.rss(
action="subscribe",
url="https://news.example.com/rss/technology"
)
# List all subscribed feedsfeeds=agent.tool.rss(action="list")
# Read entries from a specific feedentries=agent.tool.rss(
action="read",
feed_id="news_example_com_technology",
max_entries=5,
include_content=True
)
# Search across all feedssearch_results=agent.tool.rss(
action="search",
query="machine learning",
max_entries=10
)
# Fetch feed content without subscribinglatest_news=agent.tool.rss(
action="fetch",
url="https://blog.example.org/feed",
max_entries=3
)

Use Computer

fromstrandsimportAgentfromstrands_toolsimportuse_computeragent=Agent(tools=[use_computer])
# Find mouse positionresult=agent.tool.use_computer(action="mouse_position")
# Automate adding textresult=agent.tool.use_computer(action="type", text="Hello, world!", app_name="Notepad")
# Analyze current computer screenresult=agent.tool.use_computer(action="analyze_screen")
result=agent.tool.use_computer(action="open_app", app_name="Calculator")
result=agent.tool.use_computer(action="close_app", app_name="Calendar")
result=agent.tool.use_computer(
action="hotkey",
hotkey_str="command+ctrl+f", # For macOSapp_name="Chrome"
)

Graph (Multi-Agent DAG)

Create deterministic DAG-based multi-agent pipelines where agents are nodes with dependency relationships. Unlike agent_graph (which uses persistent message-passing), graph uses task-based execution with output propagation.

fromstrandsimportAgentfromstrands_tools.graphimportgraphagent=Agent(tools=[graph])
# Create a multi-agent research pipelineresult=agent.tool.graph(
action="create",
graph_id="research_pipeline",
topology={
"nodes": [
{
"id": "researcher",
"role": "researcher",
"system_prompt": "You research topics thoroughly.",
"model_provider": "bedrock",
"model_settings": {"model_id": "us.anthropic.claude-sonnet-4-20250514-v1:0"}
},
{
"id": "analyst",
"role": "analyst",
"system_prompt": "You analyze research data.",
"model_provider": "bedrock",
"model_settings": {"model_id": "us.anthropic.claude-3-5-haiku-20241022-v1:0"}
},
{
"id": "reporter",
"role": "reporter",
"system_prompt": "You create comprehensive reports.",
"tools": ["file_write", "editor"]
}
],
"edges": [
{"from": "researcher", "to": "analyst"},
{"from": "analyst", "to": "reporter"}
],
"entry_points": ["researcher"]
}
)
# Execute a task through the graphresult=agent.tool.graph(
action="execute",
graph_id="research_pipeline",
task="Research and analyze the impact of AI on healthcare"
)
# Get graph statusresult=agent.tool.graph(action="status", graph_id="research_pipeline")
# List all graphsresult=agent.tool.graph(action="list")
# Delete a graphresult=agent.tool.graph(action="delete", graph_id="research_pipeline")

Elasticsearch Memory

Note: This tool requires AWS account credentials to generate embeddings using Amazon Bedrock Titan models.

fromstrandsimportAgentfromstrands_tools.elasticsearch_memoryimportElasticsearchMemoryTool, elasticsearch_memory# Bind connection, index, and namespace per principal (kept out of the agent-facing tool)memory_tool=ElasticsearchMemoryTool(
cloud_id="your-elasticsearch-cloud-id", # or es_url="https://...:443" for Serverlessapi_key="your-api-key",
index_name="memories",
namespace="user_123",
)
agent=Agent(tools=[memory_tool.elasticsearch_memory])
# Store a memory with semantic embeddingsresult=agent.tool.elasticsearch_memory(
action="record",
content="User prefers vegetarian pizza with extra cheese",
metadata={"category": "food_preferences", "type": "dietary"},
)
# Search memories using semantic similarity (vector search)result=agent.tool.elasticsearch_memory(
action="retrieve",
query="food preferences and dietary restrictions",
max_results=5,
)
# List all memories with paginationresult=agent.tool.elasticsearch_memory(action="list", max_results=10)
# Get specific memory by IDresult=agent.tool.elasticsearch_memory(action="get", memory_id="mem_1234567890_abcd1234")
# Delete a memoryresult=agent.tool.elasticsearch_memory(action="delete", memory_id="mem_1234567890_abcd1234")
# Single-tenant: use the standalone tool with configuration from environment variablesagent=Agent(tools=[elasticsearch_memory])
result=agent.tool.elasticsearch_memory(action="record", content="User prefers vegetarian pizza")

MongoDB Atlas Memory

Note: This tool requires AWS account credentials to generate embeddings using Amazon Bedrock Titan models.

fromstrandsimportAgentfromstrands_tools.mongodb_memoryimportMongoDBMemoryTool, mongodb_memory# Bind connection, collection, and namespace per principal (kept out of the agent-facing tool)memory_tool=MongoDBMemoryTool(
cluster_uri="mongodb+srv://username:password@cluster0.mongodb.net/?retryWrites=true&w=majority",
database_name="memories",
collection_name="user_memories",
namespace="user_123",
)
agent=Agent(tools=[memory_tool.mongodb_memory])
# Store a memory with semantic embeddingsresult=agent.tool.mongodb_memory(
action="record",
content="User prefers vegetarian pizza with extra cheese",
metadata={"category": "food_preferences", "type": "dietary"},
)
# Search memories using semantic similarity (vector search)result=agent.tool.mongodb_memory(
action="retrieve",
query="food preferences and dietary restrictions",
max_results=5,
)
# List all memories with paginationresult=agent.tool.mongodb_memory(action="list", max_results=10)
# Get specific memory by IDresult=agent.tool.mongodb_memory(action="get", memory_id="mem_1234567890_abcd1234")
# Delete a memoryresult=agent.tool.mongodb_memory(action="delete", memory_id="mem_1234567890_abcd1234")
# Single-tenant: use the standalone tool with configuration from environment variablesagent=Agent(tools=[mongodb_memory])
result=agent.tool.mongodb_memory(action="record", content="User prefers vegetarian pizza")

🌍 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_NON_INTERACTIVERun tools without interactive prompts, set to "true" to suppress confirmation dialogsfalseTools with a confirmation prompt (e.g. shell, 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

Tavily Search, Extract, Crawl, and Map Tools

Environment VariableDescriptionDefault
TAVILY_API_KEYTavily API key (required for all Tavily functionality)None

Exa Search and Contents Tools

Environment VariableDescriptionDefault
EXA_API_KEYExa API key (required for all Exa functionality)None

Mem0 Memory Tool

Security Model: The tenant-isolation keys (user_id / agent_id) are never exposed as agent-facing tool parameters. The agent only chooses the action and its content/query/memory_id. This prevents a model (or prompt-injected content) from reading, writing, or deleting another tenant's memories.

Usage patterns:

fromstrandsimportAgentfromstrands_tools.mem0_memoryimportMem0MemoryTool, mem0_memory# Multi-tenant (recommended): bind identity per authenticated principaltool=Mem0MemoryTool(user_id=f"user_{authenticated_user_id}")
agent=Agent(tools=[tool.mem0_memory])
agent.tool.mem0_memory(action="store", content="User prefers vegetarian pizza")
# Single-tenant: use the standalone function with env vars (MEM0_USER_ID / MEM0_AGENT_ID)agent=Agent(tools=[mem0_memory])
agent.tool.mem0_memory(action="store", content="User prefers vegetarian pizza")

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
  4. Neptune Analytics (Optional Graph backend for search enhancement):

    • Uses Neptune Analytics as the graph store backend to enhance memory recall.
    • Requires AWS credentials and Neptune Analytics configuration
    # Configure your Neptune Analytics graph ID in the .env file:
    export NEPTUNE_ANALYTICS_GRAPH_IDENTIFIER=sample-graph-id
    # Configure your Neptune Analytics graph ID in Python code:
    import os
    os.environ['NEPTUNE_ANALYTICS_GRAPH_IDENTIFIER'] = "g-sample-graph-id"
    
Environment VariableDescriptionDefaultRequired For
MEM0_USER_IDUser ID for memory operations (standalone function)NoneStandalone
MEM0_AGENT_IDAgent ID for memory operations (standalone function)NoneStandalone
MEM0_API_KEYMem0 Platform API keyNoneMem0 Platform
OPENSEARCH_HOSTOpenSearch Host URLNoneOpenSearch
AWS_REGIONAWS Region for OpenSearchus-west-2OpenSearch
NEPTUNE_ANALYTICS_GRAPH_IDENTIFIERNeptune Analytics Graph IdentifierNoneNeptune Analytics
DEVEnable development mode (bypasses confirmations)falseAll modes
MEM0_LLM_PROVIDERLLM provider for memory processingaws_bedrockAll modes
MEM0_LLM_MODELLLM model for memory processinganthropic.claude-3-5-haiku-20241022-v1:0All modes
MEM0_LLM_TEMPERATURELLM temperature (0.0-2.0)0.1All modes
MEM0_LLM_MAX_TOKENSLLM maximum tokens2000All modes
MEM0_EMBEDDER_PROVIDEREmbedder provider for vector embeddingsaws_bedrockAll modes
MEM0_EMBEDDER_MODELEmbedder model for vector embeddingsamazon.titan-embed-text-v2:0All 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)
  • If NEPTUNE_ANALYTICS_GRAPH_IDENTIFIER is set, the tool will configure Neptune Analytics as graph store to enhance memory search
  • LLM configuration applies to all backend modes and allows customization of the language model used for memory processing

Bright Data Tool

Environment VariableDescriptionDefault
BRIGHTDATA_API_KEYBright Data API KeyNone
BRIGHTDATA_ZONEBright Data Web Unlocker Zoneweb_unlocker1

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
PYTHON_REPL_INTERACTIVEWhether to enable interactive PTY modeNone
PYTHON_REPL_RESET_STATEWhether to reset the REPL state before executionNone
PYTHON_REPL_PERSISTENCE_DIRSet Directory for python_repl tool to write state fileNone

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
EDITOR_DISABLE_BACKUPSkip creating .bak backup files during edit operationsfalse

Environment Tool

Environment VariableDescriptionDefault
ENV_VARS_MASKED_DEFAULTMasking of values whose name contains TOKEN, SECRET, PASSWORD, KEY, or AUTH. Set to false to disable. This is the only way to configure masking: the agent cannot override it through tool input, and the environment tool cannot set it. Tools that execute arbitrary code in the agent process, such as python_repl and shell, can still write ittrue

HTTP Request Tool

Environment VariableDescriptionDefault
STRANDS_HTTP_ALLOW_INSECURE_SSLAllow disabling SSL certificate verification via verify_ssl parameterfalse

Dynamic MCP Client Tool

Environment VariableDescriptionDefault
STRANDS_MCP_TIMEOUTDefault timeout in seconds for MCP operations30.0

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

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

RSS Tool

Environment VariableDescriptionDefault
STRANDS_RSS_MAX_ENTRIESDefault setting for maximum number of entries per feed100
STRANDS_RSS_UPDATE_INTERVALDefault amount of time between updating rss feeds in minutes60
STRANDS_RSS_STORAGE_PATHDefault storage path where rss feeds are stored locallystrands_rss_feeds (this may vary based on your system)

Retrieve Tool

Environment VariableDescriptionDefault
RETRIEVE_ENABLE_METADATA_DEFAULTDefault setting for enabling metadata in retrieve tool responsesfalse

Use Agent Tool

Environment VariableDescriptionDefault
STRANDS_PROVIDERDefault model provider when using model_provider="env"ollama
STRANDS_MODEL_IDDefault model identifier for environment-based model selectionNone
STRANDS_MAX_TOKENSMaximum tokens for the nested agent modelNone
STRANDS_TEMPERATURESampling temperature for the nested agent modelNone

Elasticsearch Memory Tool

Environment VariableDescriptionDefault
ELASTICSEARCH_CLOUD_IDElasticsearch Cloud ID for connectionNone
ELASTICSEARCH_URLElasticsearch URL for serverless connectionNone
ELASTICSEARCH_API_KEYElasticsearch API key for authenticationNone
ELASTICSEARCH_INDEX_NAMEElasticsearch index name for memory storagestrands_memory
ELASTICSEARCH_NAMESPACENamespace for memory isolationdefault
ELASTICSEARCH_EMBEDDING_MODELAmazon Bedrock model for embeddingsamazon.titan-embed-text-v2:0
AWS_REGIONAWS region for Bedrock embedding serviceus-west-2

Note: This tool requires AWS account credentials to generate embeddings using Amazon Bedrock Titan models.

Graph Tool

The graph tool uses the same model provider environment variables as use_agent for per-node model configuration. No additional environment variables are required.

Video Tools

Environment VariableDescriptionDefault
TWELVELABS_API_KEYTwelveLabs API key for video analysisNone
TWELVELABS_MARENGO_INDEX_IDDefault index ID for search_video toolNone
TWELVELABS_PEGASUS_INDEX_IDDefault index ID for chat_video toolNone

MongoDB Atlas Memory Tool

Environment VariableDescriptionDefault
MONGODB_ATLAS_CLUSTER_URIMongoDB Atlas connection stringNone
MONGODB_DATABASE_NAMEDatabase name for MongoDB operationsstrands_memory
MONGODB_COLLECTION_NAMECollection name for MongoDB operationsmemories
MONGODB_NAMESPACENamespace for memory isolationdefault
MONGODB_EMBEDDING_MODELAmazon Bedrock model for embeddingsamazon.titan-embed-text-v2:0

Note: This tool requires AWS account credentials to generate embeddings using Amazon Bedrock Titan models.

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!

Stay in touch with the team

Come meet the Strands team and other users on Discord

License

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

Security

The tools in this repository are experimental and are provided as-is. Any production use should be preceded by an independent security review of the specific tools you enable.

For guidance on building and deploying agents safely, see Responsible AI in the Strands Agents documentation.

To report a security issue, 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 versionsStrands Discord

DocumentationSamplesPython SDKToolsAgent BuilderMCP Server

Strands Agents Tools is a community-driven project that 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, Amazon Bedrock Knowledge Bases, Elasticsearch, and MongoDB Atlas
  • 🕸️ Web Infrastructure - Perform web searches, extract page content, and crawl websites with Tavily and Exa-powered tools
  • 🌐 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
  • 🤖 Agent as Tool - Create nested agent instances with model switching support for multi-model workflows and specialized sub-tasks
  • 🔗 Multi-Agent Graph - Create and manage deterministic DAG-based multi-agent pipelines with output propagation and per-node model configuration
  • 🔌 Dynamic MCP Client - ⚠️ Dynamically connect to external MCP servers and load remote tools (use with caution - see security warnings)
  • 🔄 Multiple Tools per Turn - Call several other tools from one model response with Batch Tool
  • 🔍 Browser Tool - Tool giving an agent access to perform automated actions on a browser (chromium)
  • 📈 Diagram - Create AWS cloud diagrams, basic diagrams, or UML diagrams using python libraries
  • 📰 RSS Feed Manager - Subscribe, fetch, and process RSS feeds with content filtering and persistent storage
  • 🖱️ Computer Tool - Automate desktop actions including mouse movements, keyboard input, screenshots, and application management

Important

The tools in this repository are experimental. Many of them grant agents powerful capabilities — executing code, accessing the file system, calling AWS APIs, connecting to external servers, and automating browsers and desktops — which carry real security implications. Any production use should be preceded by your own independent security review; see the Responsible AI guidance for best practices. Use of these tools is at your own risk.

📦 Installation

Quick Install

pip install strands-agents-tools

To install the dependencies for optional tools:

pip install "strands-agents-tools[mem0_memory, use_browser, rss, use_computer]"

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
editor ⚠️agent.tool.editor(command="view", path="path/to/file.py")Advanced file operations like syntax highlighting, pattern replacement, and multi-file edits
Deprecated — see Deprecations
shell* ⚠️agent.tool.shell(command="ls -la")Executing shell commands, interacting with the operating system, running scripts
Deprecated — see Deprecations
http_requestagent.tool.http_request(method="GET", url="https://api.example.com/data")Making API calls, fetching web data, sending data to external services
tavily_searchagent.tool.tavily_search(query="What is artificial intelligence?", search_depth="advanced")Real-time web search optimized for AI agents with a variety of custom parameters
tavily_extractagent.tool.tavily_extract(urls=["www.tavily.com"], extract_depth="advanced")Extract clean, structured content from web pages with advanced processing and noise removal
tavily_crawlagent.tool.tavily_crawl(url="www.tavily.com", max_depth=2, instructions="Find API docs")Crawl websites intelligently starting from a base URL with filtering and extraction
tavily_mapagent.tool.tavily_map(url="www.tavily.com", max_depth=2, instructions="Find all pages")Map website structure and discover URLs starting from a base URL without content extraction
exa_searchagent.tool.exa_search(query="Best project management tools", text=True)Intelligent web search with auto mode (default) for optimal results, plus fast and deep search modes
exa_get_contentsagent.tool.exa_get_contents(urls=["https://example.com/article"], text=True, summary={"query": "key points"})Extract full content and summaries from specific URLs with live crawling fallback
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
calculator ⚠️agent.tool.calculator(expression="2 * sin(pi/4) + log(e**2)")Performing mathematical operations, symbolic math, equation solving
Deprecated — see Deprecations
code_interpretercode_interpreter = AgentCoreCodeInterpreter(region="us-west-2"); agent = Agent(tools=[code_interpreter.code_interpreter])Execute code in isolated sandbox environments with multi-language support (Python, JavaScript, TypeScript), persistent sessions, and file operations
use_awsagent.tool.use_aws(service_name="s3", operation_name="list_buckets", parameters={}, region="us-west-2")Interacting with AWS services, cloud resource management
retrieve ⚠️agent.tool.retrieve(text="What is STRANDS?")Retrieving information from Amazon Bedrock Knowledge Bases with optional metadata
Deprecated — see Deprecations
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
agent_core_memoryagent.tool.agent_core_memory(action="record", content="Hello, I like vegetarian food")Store and retrieve memories with Amazon Bedrock Agent Core Memory service
mem0_memoryagent.tool.mem0_memory(action="store", content="Remember I like to play tennis")Store user and agent memories across agent runs to provide personalized experience (tenant identity configured via Mem0MemoryTool or environment variables)
bright_dataagent.tool.bright_data(action="scrape_as_markdown", url="https://example.com")Web scraping, search queries, screenshot capture, and structured data extraction from websites and different data feeds
memory ⚠️agent.tool.memory(action="retrieve", query="product features")Store, retrieve, list, and manage documents in Amazon Bedrock Knowledge Bases with configurable parameters via environment variables
Deprecated — see Deprecations
environment ⚠️agent.tool.environment(action="list", prefix="AWS_")Managing environment variables, configuration management
Deprecated — see Deprecations
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
think ⚠️agent.tool.think(thought="Complex problem to analyze", cycle_count=3)Advanced reasoning, multi-step thinking processes
Deprecated — see Deprecations
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_time ⚠️agent.tool.current_time(timezone="US/Pacific")Get the current time in ISO 8601 format for a specified timezone
Deprecated — see Deprecations
sleep ⚠️agent.tool.sleep(seconds=5)Pause execution for the specified number of seconds, interruptible with SIGINT (Ctrl+C)
Deprecated — see Deprecations
agent_graphagent.tool.agent_graph(agents=["agent1", "agent2"], connections=[{"from": "agent1", "to": "agent2"}])Create and visualize agent relationship graphs for complex multi-agent systems
graphagent.tool.graph(action="create", graph_id="pipeline", topology={"nodes": [...], "edges": [...]})Create and manage deterministic DAG-based multi-agent graphs using Strands SDK Graph implementation with per-node model configuration
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
Deprecated — see Deprecations
slack ⚠️agent.tool.slack(action="post_message", channel="general", text="Hello team!")Interact with Slack workspace for messaging and monitoring
Deprecated — see Deprecations
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
use_agentagent.tool.use_agent(prompt="Analyze this code", system_prompt="You are a code analyst.", model_provider="bedrock")Create nested agent instances with model switching, multi-model workflows, cost optimization, and specialized sub-tasks
workflowagent.tool.workflow(action="create", name="data_pipeline", steps=[{"tool": "file_read"}, {"tool": "python_repl"}])Define, execute, and manage multi-step automated workflows
mcp_clientagent.tool.mcp_client(action="connect", connection_id="my_server", transport="stdio", command="python", args=["server.py"])⚠️SECURITY WARNING: Dynamically connect to external MCP servers via stdio, sse, or streamable_http, list tools, and call remote tools. This can pose security risks as agents may connect to malicious servers. Use with caution in production.
batch ⚠️agent.tool.batch(invocations=[{"name": "current_time", "arguments": {"timezone": "Europe/London"}}, {"name": "stop", "arguments": {}}])Call multiple other tools from one request.
Deprecated — see Deprecations
browserbrowser = LocalChromiumBrowser(); agent = Agent(tools=[browser.browser])Web scraping, automated testing, form filling, web automation tasks
diagram ⚠️agent.tool.diagram(diagram_type="cloud", nodes=[{"id": "s3", "type": "S3"}], edges=[])Create AWS cloud architecture diagrams, network diagrams, graphs, and UML diagrams (all 14 types)
Deprecated — see Deprecations
rss ⚠️agent.tool.rss(action="subscribe", url="https://example.com/feed.xml", feed_id="tech_news")Manage RSS feeds: subscribe, fetch, read, search, and update content from various sources
Deprecated — see Deprecations
use_computeragent.tool.use_computer(action="click", x=100, y=200, app_name="Chrome") Desktop automation, GUI interaction, screen capture
search_videoagent.tool.search_video(query="people discussing AI")Semantic video search using TwelveLabs' Marengo model
chat_videoagent.tool.chat_video(prompt="What are the main topics?", video_id="video_123")Interactive video analysis using TwelveLabs' Pegasus model
mongodb_memoryagent.tool.mongodb_memory(action="record", content="User prefers vegetarian pizza")Store and retrieve memories using MongoDB Atlas with semantic search via AWS Bedrock Titan embeddings (connection and namespace configured via MongoDBMemoryTool or environment variables)
elasticsearch_memoryagent.tool.elasticsearch_memory(action="record", content="User prefers dark mode")Store and retrieve memories using Elasticsearch with semantic search via AWS Bedrock Titan embeddings (connection and namespace configured via ElasticsearchMemoryTool or environment variables)

* These tools do not work on Windows

Deprecations

The tools below are deprecated, and each row points to where that capability now lives.

When this package started, the SDK had no built-in way to do most of these things, so we shipped tools to fill the gap. Much of that is now native: the SDK reasons, injects context, manages memory, and runs tools concurrently on its own, and where a vendor maintains an official MCP server, that server will always track their API better than a wrapper here can. Keeping a second implementation alongside means two things to fix and two things to drift, so we would rather point you at the one that gets the attention.

More tools will follow as their capabilities land elsewhere, and this repository will eventually be archived. Nothing breaks suddenly — but migrating when a tool is first deprecated is easier than moving several at once later.

Deprecated tools keep working. Each one logs a warning when invoked starting in v0.8.6, and that warning becomes an error log in v0.9.0 — a louder signal for anyone who has not migrated, not a behavior change.

They are also marked with @typing_extensions.deprecated, so type checkers and IDEs flag usage before you run anything. To list what you still need to migrate, run mypy --enable-error-code deprecated over your project: it reports the from strands_tools import ... line for each deprecated tool, without invoking any of them. Prefer mypy here: pyright, with reportDeprecated enabled, reports direct calls such as calculator(expression=...) but not agent.tool.calculator(...), and it reaches the import line for only the three tools whose marker is not wrapped by @tool. Note that Python suppresses the resulting DeprecationWarning at runtime when the agent invokes a tool, which is why the log message exists as well.

ToolSuggested alternativeWarningError log
sleepfrom strands.vended_tools import sleepv0.8.6v0.9.0
editorfrom strands.vended_tools import file_editorv0.8.6v0.9.0
shellfrom strands.vended_tools import bashv0.8.6v0.9.0
batchnone needed — concurrent tool execution is the SDK default (docs)v0.8.6v0.9.0
thinknative extended thinking via model reasoning config (docs)v0.8.6v0.9.0
current_timeContextInjector (docs)v0.8.6v0.9.0
memoryMemoryManager + BedrockKnowledgeBaseStore (docs)v0.8.6v0.9.0
retrieveMemoryManager + BedrockKnowledgeBaseStore(writable=False) (docs)v0.8.6v0.9.0
calculatorfrom strands.vended_tools import bash (run python3 -c with sympy)v0.8.6v0.9.0
cronfrom strands.vended_tools import bash (manage crontab), or Amazon EventBridge Schedulerv0.8.6v0.9.0
environmentfrom strands.vended_tools import bash (inspect only, see notes)v0.8.6v0.9.0
slackofficial Slack MCP server; slack_bolt for Socket Modev0.8.6v0.9.0
diagramno replacement — have the model write graphviz/mermaid/diagrams code directlyv0.8.6v0.9.0
rssno replacement — parse feeds directly with feedparserv0.8.6v0.9.0
# BeforefromstrandsimportAgentfromstrands_toolsimporteditor, shell, sleepagent=Agent(tools=[editor, shell, sleep])
# AfterfromstrandsimportAgentfromstrands.vended_toolsimportbash, file_editor, sleepagent=Agent(tools=[bash, file_editor, sleep])

Behavior differences

The replacements are not drop-in equivalents. Check these before migrating:

  • shellbash: the SDK tool routes commands through the agent's configured sandbox and is stateless — each call runs in a fresh shell, so variables and the working directory do not persist between calls. It does not provide PTY support or batched parallel/sequential command execution.
  • editorfile_editor: supports view, create, str_replace, and insert. The pattern_replace, find_line, and undo_edit commands have no SDK equivalent.
  • sleepsleep: the maximum duration is set with make_sleep(max_duration=...) and defaults to 60 seconds, replacing the MAX_SLEEP_SECONDS environment variable which defaulted to 300 seconds.
  • batch — you can drop it. The SDK runs tool calls concurrently by default via ConcurrentToolExecutor, which also keeps tracing, metrics, and hooks intact. See Tool executors.
  • think → extended thinking — reasoning is now a model capability rather than a tool, so you configure it once instead of prompting for it. It is single-pass, so if you were relying on cycle_count to refine across passes, or on tool calls inside the reasoning loop, that pattern moves into your own orchestration. Config is per provider — see Amazon Bedrock.
  • current_timeContextInjector — the date is context, not something the agent should have to ask for, so injecting it means it is always fresh and the model cannot forget to call it. The trade-off is that your code picks the timezone; if you need the model to choose one per call, the official MCP time server still does that. See ContextInjector.
  • memory / retrieve → memory stores — memory is a first-class SDK concept now, so stores plug into the agent and inject context automatically instead of waiting to be called. store/retrieve become add/search. list, get, and delete are not part of the store protocol, so keep them as backend-native tools via get_tools(). One thing to know: the store returns relevance scores but does not filter on them, so if you relied on retrieve's default score >= 0.4 floor, apply it yourself. See Bedrock Knowledge Base store and Custom stores.
  • calculatorshell — run python3 -c with sympy for the same symbolic math. Worth being explicit: shell runs whatever it is given, whereas this tool checked expressions against an allowlist first. If you are evaluating untrusted input, put a sandbox behind the shell tool or keep your own validation in front of it.
  • cronshellcrontab through the shell tool covers scheduling on a host. Two things to plan for: the shell is sandbox-routed, so under Docker or SSH your jobs land in an environment that may not have a cron daemon, and you will be composing crontab lines yourself rather than using structured list/add/remove/edit actions. For scheduling that outlives the host, Amazon EventBridge Scheduler is usually the better fit.
  • environmentshellenv and printenv cover reading. Setting is genuinely different: a child shell cannot change the agent's own process environment, so variables need to be set where the agent is launched, or passed per call. If you were leaning on PROTECTED_VARS or secret masking, that guarding moves to your side.
  • slack → Slack's official MCP server — Slack maintains it, so it tracks their API directly, and it uses OAuth rather than long-lived tokens. It exposes a curated tool set rather than this tool's passthrough to any Web API method, and being request/response it does not cover Socket Mode or real-time events — slack_bolt remains the right tool for event listeners. Endpoint and setup: docs.slack.dev/ai/mcp-server.
  • diagram — no direct replacement, and that is deliberate: this tool was a wrapper over graphviz and the diagrams package, and a capable model writes that code well on its own. The wrapper mostly added a layer to keep in sync.
  • rss — no direct replacement. Fetching and parsing a feed is a few lines of feedparser, and the subscription list was a JSON file. If you were using feed HTTP Basic auth or the stored subscriptions, those move into your code.

💻 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")

Dynamic MCP Client Integration

⚠️SECURITY WARNING: The Dynamic MCP Client allows agents to autonomously connect to external MCP servers and load remote tools at runtime. This poses significant security risks as agents can potentially connect to malicious servers and execute untrusted code. Use with extreme caution in production environments.

This tool is different from the static MCP server implementation in the Strands SDK (see MCP Tools Documentation) which uses pre-configured, trusted MCP servers.

fromstrandsimportAgentfromstrands_toolsimportmcp_clientagent=Agent(tools=[mcp_client])
# Connect to a custom MCP server via stdioagent.tool.mcp_client(
action="connect",
connection_id="my_tools",
transport="stdio",
command="python",
args=["my_mcp_server.py"]
)
# List available tools on the servertools=agent.tool.mcp_client(
action="list_tools",
connection_id="my_tools"
)
# Call a tool from the MCP serverresult=agent.tool.mcp_client(
action="call_tool",
connection_id="my_tools",
tool_name="calculate",
tool_args={"x": 10, "y": 20}
)
# Connect to a SSE-based serveragent.tool.mcp_client(
action="connect",
connection_id="web_server",
transport="sse",
server_url="http://localhost:8080/sse"
)
# Connect to a streamable HTTP serveragent.tool.mcp_client(
action="connect",
connection_id="http_server",
transport="streamable_http",
server_url="https://api.example.com/mcp",
headers={"Authorization": "Bearer token"},
timeout=60
)
# Load MCP tools into agent's registry for direct access# ⚠️ WARNING: This loads external tools directly into the agentagent.tool.mcp_client(
action="load_tools",
connection_id="my_tools"
)
# Now you can call MCP tools directly as: agent.tool.calculate(x=10, y=20)

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
)

Tavily Search, Extract, Crawl, and Map

fromstrandsimportAgentfromstrands_tools.tavilyimport (
tavily_search, tavily_extract, tavily_crawl, tavily_map
)
# For async usage, call the corresponding *_async function with await.# Synchronous usage agent=Agent(tools=[tavily_search, tavily_extract, tavily_crawl, tavily_map])
# Real-time web searchresult=agent.tool.tavily_search(
query="Latest developments in renewable energy",
search_depth="advanced",
topic="news",
max_results=10,
include_raw_content=True
)
# Extract content from multiple URLsresult=agent.tool.tavily_extract(
urls=["www.tavily.com", "www.apple.com"],
extract_depth="advanced",
format="markdown"
)
# Advanced crawl with instructions and filteringresult=agent.tool.tavily_crawl(
url="www.tavily.com",
max_depth=2,
limit=50,
instructions="Find all API documentation and developer guides",
extract_depth="advanced",
include_images=True
)
# Basic website mappingresult=agent.tool.tavily_map(url="www.tavily.com")

Exa Search and Contents

fromstrandsimportAgentfromstrands_tools.exaimportexa_search, exa_get_contentsagent=Agent(tools=[exa_search, exa_get_contents])
# Basic search (auto mode is default and recommended)result=agent.tool.exa_search(
query="Best project management software",
text=True
)
# Company-specific search when neededresult=agent.tool.exa_search(
query="Anthropic AI safety research",
category="company",
include_domains=["anthropic.com"],
num_results=5,
summary={"query": "key research areas and findings"}
)
# News search with date filteringresult=agent.tool.exa_search(
query="AI regulation policy updates",
category="news",
start_published_date="2024-01-01T00:00:00.000Z",
text=True
)
# Get detailed content from specific URLsresult=agent.tool.exa_get_contents(
urls=[
"https://example.com/blog-post",
"https://github.com/microsoft/semantic-kernel"
],
text={"maxCharacters": 5000, "includeHtmlTags": False},
summary={
"query": "main points and practical applications"
},
subpages=2,
extras={"links": 5, "imageLinks": 2}
)
# Structured summary with JSON schemaresult=agent.tool.exa_get_contents(
urls=["https://example.com/article"],
summary={
"query": "main findings and recommendations",
"schema": {
"type": "object",
"properties": {
"main_points": {"type": "string", "description": "Key points from the article"},
"recommendations": {"type": "string", "description": "Suggested actions or advice"},
"conclusion": {"type": "string", "description": "Overall conclusion"},
"relevance": {"type": "string", "description": "Why this matters"}
},
"required": ["main_points", "conclusion"]
}
}
)

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()""")

Code Interpreter

fromstrandsimportAgentfromstrands_tools.code_interpreterimportAgentCoreCodeInterpreter# Create the code interpreter toolbedrock_agent_core_code_interpreter=AgentCoreCodeInterpreter(region="us-west-2")
agent=Agent(tools=[bedrock_agent_core_code_interpreter.code_interpreter])
# Create a sessionagent.tool.code_interpreter({
"action": {
"type": "initSession",
"description": "Data analysis session",
"session_name": "analysis-session"
}
})
# Execute Python codeagent.tool.code_interpreter({
"action": {
"type": "executeCode",
"session_name": "analysis-session",
"code": "print('Hello from sandbox!')",
"language": "python"
}
})

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"
)

Retrieve Tool

fromstrandsimportAgentfromstrands_toolsimportretrieveagent=Agent(tools=[retrieve])
# Basic retrieval without metadataresult=agent.tool.retrieve(
text="What is artificial intelligence?"
)
# Retrieval with metadata enabledresult=agent.tool.retrieve(
text="What are the latest developments in machine learning?",
enableMetadata=True
)
# Using environment variable to set default metadata behavior# Set RETRIEVE_ENABLE_METADATA_DEFAULT=true in your environmentresult=agent.tool.retrieve(
text="Tell me about cloud computing"# enableMetadata will default to the environment variable value
)

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"
}
},
]
)

Video Tools

fromstrandsimportAgentfromstrands_toolsimportsearch_video, chat_videoagent=Agent(tools=[search_video, chat_video])
# Search for video content using natural languageresult=agent.tool.search_video(
query="people discussing AI technology",
threshold="high",
group_by="video",
page_limit=5
)
# Chat with existing video (no index_id needed)result=agent.tool.chat_video(
prompt="What are the main topics discussed in this video?",
video_id="existing-video-id"
)
# Chat with new video file (index_id required for upload)result=agent.tool.chat_video(
prompt="Describe what happens in this video",
video_path="/path/to/video.mp4",
index_id="your-index-id"# or set TWELVELABS_PEGASUS_INDEX_ID env var
)

AgentCore Memory

fromstrandsimportAgentfromstrands_tools.agent_core_memoryimportAgentCoreMemoryToolProviderprovider=AgentCoreMemoryToolProvider(
memory_id="memory-123abc", # Requiredactor_id="user-456", # Requiredsession_id="session-789", # Requirednamespace="default", # Requiredregion="us-west-2"# Optional, defaults to us-west-2
)
agent=Agent(tools=provider.tools)
# Create a new memoryresult=agent.tool.agent_core_memory(
action="record",
content="I am allergic to shellfish"
)
# Search for relevant memoriesresult=agent.tool.agent_core_memory(
action="retrieve",
query="user preferences"
)
# List all memoriesresult=agent.tool.agent_core_memory(
action="list"
)
# Get a specific memory by IDresult=agent.tool.agent_core_memory(
action="get",
memory_record_id="mr-12345"
)

Browser

fromstrandsimportAgentfromstrands_tools.browserimportLocalChromiumBrowser# Create browser toolbrowser=LocalChromiumBrowser()
agent=Agent(tools=[browser.browser])
# Simple navigationresult=agent.tool.browser({
"action": {
"type": "navigate",
"url": "https://example.com"
}
})
# Initialize a session firstresult=agent.tool.browser({
"action": {
"type": "initSession",
"session_name": "main-session",
"description": "Web automation session"
}
})

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
)

Use Agent (Agent as Tool)

fromstrandsimportAgentfromstrands_toolsimportuse_agentagent=Agent(tools=[use_agent])
# Basic usage - inherits parent agent's modelresult=agent.tool.use_agent(
prompt="Tell me about the advantages of tool-building in AI agents",
system_prompt="You are a helpful AI assistant specializing in AI development concepts."
)
# Use a different model provider for specialized tasksresult=agent.tool.use_agent(
prompt="Calculate 2 + 2 and explain the result",
system_prompt="You are a helpful math assistant.",
model_provider="bedrock",
model_settings={
"model_id": "us.anthropic.claude-sonnet-4-20250514-v1:0"
},
tools=["calculator"]
)
# Use environment variables to determine modelimportosos.environ["STRANDS_PROVIDER"] ="ollama"os.environ["STRANDS_MODEL_ID"] ="qwen3:4b"result=agent.tool.use_agent(
prompt="Analyze this code",
system_prompt="You are a code review assistant.",
model_provider="env"
)
# Custom model configuration with specific parametersresult=agent.tool.use_agent(
prompt="Write a creative story",
system_prompt="You are a creative writing assistant.",
model_provider="github",
model_settings={
"model_id": "openai/o4-mini",
"params": {"temperature": 1, "max_tokens": 4000}
}
)

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

Diagram

fromstrandsimportAgentfromstrands_toolsimportdiagramagent=Agent(tools=[diagram])
# Create an AWS cloud architecture diagramresult=agent.tool.diagram(
diagram_type="cloud",
nodes=[
{"id": "users", "type": "Users", "label": "End Users"},
{"id": "cloudfront", "type": "CloudFront", "label": "CDN"},
{"id": "s3", "type": "S3", "label": "Static Assets"},
{"id": "api", "type": "APIGateway", "label": "API Gateway"},
{"id": "lambda", "type": "Lambda", "label": "Backend Service"}
],
edges=[
{"from": "users", "to": "cloudfront"},
{"from": "cloudfront", "to": "s3"},
{"from": "users", "to": "api"},
{"from": "api", "to": "lambda"}
],
title="Web Application Architecture"
)
# Create a UML class diagramresult=agent.tool.diagram(
diagram_type="class",
elements=[
{
"name": "User",
"attributes": ["+id: int", "-name: string", "#email: string"],
"methods": ["+login(): bool", "+logout(): void"]
},
{
"name": "Order",
"attributes": ["+id: int", "-items: List", "-total: float"],
"methods": ["+addItem(item): void", "+calculateTotal(): float"]
}
],
relationships=[
{"from": "User", "to": "Order", "type": "association", "multiplicity": "1..*"}
],
title="E-commerce Domain Model"
)

RSS Feed Management

fromstrandsimportAgentfromstrands_toolsimportrssagent=Agent(tools=[rss])
# Subscribe to a feedresult=agent.tool.rss(
action="subscribe",
url="https://news.example.com/rss/technology"
)
# List all subscribed feedsfeeds=agent.tool.rss(action="list")
# Read entries from a specific feedentries=agent.tool.rss(
action="read",
feed_id="news_example_com_technology",
max_entries=5,
include_content=True
)
# Search across all feedssearch_results=agent.tool.rss(
action="search",
query="machine learning",
max_entries=10
)
# Fetch feed content without subscribinglatest_news=agent.tool.rss(
action="fetch",
url="https://blog.example.org/feed",
max_entries=3
)

Use Computer

fromstrandsimportAgentfromstrands_toolsimportuse_computeragent=Agent(tools=[use_computer])
# Find mouse positionresult=agent.tool.use_computer(action="mouse_position")
# Automate adding textresult=agent.tool.use_computer(action="type", text="Hello, world!", app_name="Notepad")
# Analyze current computer screenresult=agent.tool.use_computer(action="analyze_screen")
result=agent.tool.use_computer(action="open_app", app_name="Calculator")
result=agent.tool.use_computer(action="close_app", app_name="Calendar")
result=agent.tool.use_computer(
action="hotkey",
hotkey_str="command+ctrl+f", # For macOSapp_name="Chrome"
)

Graph (Multi-Agent DAG)

Create deterministic DAG-based multi-agent pipelines where agents are nodes with dependency relationships. Unlike agent_graph (which uses persistent message-passing), graph uses task-based execution with output propagation.

fromstrandsimportAgentfromstrands_tools.graphimportgraphagent=Agent(tools=[graph])
# Create a multi-agent research pipelineresult=agent.tool.graph(
action="create",
graph_id="research_pipeline",
topology={
"nodes": [
{
"id": "researcher",
"role": "researcher",
"system_prompt": "You research topics thoroughly.",
"model_provider": "bedrock",
"model_settings": {"model_id": "us.anthropic.claude-sonnet-4-20250514-v1:0"}
},
{
"id": "analyst",
"role": "analyst",
"system_prompt": "You analyze research data.",
"model_provider": "bedrock",
"model_settings": {"model_id": "us.anthropic.claude-3-5-haiku-20241022-v1:0"}
},
{
"id": "reporter",
"role": "reporter",
"system_prompt": "You create comprehensive reports.",
"tools": ["file_write", "editor"]
}
],
"edges": [
{"from": "researcher", "to": "analyst"},
{"from": "analyst", "to": "reporter"}
],
"entry_points": ["researcher"]
}
)
# Execute a task through the graphresult=agent.tool.graph(
action="execute",
graph_id="research_pipeline",
task="Research and analyze the impact of AI on healthcare"
)
# Get graph statusresult=agent.tool.graph(action="status", graph_id="research_pipeline")
# List all graphsresult=agent.tool.graph(action="list")
# Delete a graphresult=agent.tool.graph(action="delete", graph_id="research_pipeline")

Elasticsearch Memory

Note: This tool requires AWS account credentials to generate embeddings using Amazon Bedrock Titan models.

fromstrandsimportAgentfromstrands_tools.elasticsearch_memoryimportElasticsearchMemoryTool, elasticsearch_memory# Bind connection, index, and namespace per principal (kept out of the agent-facing tool)memory_tool=ElasticsearchMemoryTool(
cloud_id="your-elasticsearch-cloud-id", # or es_url="https://...:443" for Serverlessapi_key="your-api-key",
index_name="memories",
namespace="user_123",
)
agent=Agent(tools=[memory_tool.elasticsearch_memory])
# Store a memory with semantic embeddingsresult=agent.tool.elasticsearch_memory(
action="record",
content="User prefers vegetarian pizza with extra cheese",
metadata={"category": "food_preferences", "type": "dietary"},
)
# Search memories using semantic similarity (vector search)result=agent.tool.elasticsearch_memory(
action="retrieve",
query="food preferences and dietary restrictions",
max_results=5,
)
# List all memories with paginationresult=agent.tool.elasticsearch_memory(action="list", max_results=10)
# Get specific memory by IDresult=agent.tool.elasticsearch_memory(action="get", memory_id="mem_1234567890_abcd1234")
# Delete a memoryresult=agent.tool.elasticsearch_memory(action="delete", memory_id="mem_1234567890_abcd1234")
# Single-tenant: use the standalone tool with configuration from environment variablesagent=Agent(tools=[elasticsearch_memory])
result=agent.tool.elasticsearch_memory(action="record", content="User prefers vegetarian pizza")

MongoDB Atlas Memory

Note: This tool requires AWS account credentials to generate embeddings using Amazon Bedrock Titan models.

fromstrandsimportAgentfromstrands_tools.mongodb_memoryimportMongoDBMemoryTool, mongodb_memory# Bind connection, collection, and namespace per principal (kept out of the agent-facing tool)memory_tool=MongoDBMemoryTool(
cluster_uri="mongodb+srv://username:password@cluster0.mongodb.net/?retryWrites=true&w=majority",
database_name="memories",
collection_name="user_memories",
namespace="user_123",
)
agent=Agent(tools=[memory_tool.mongodb_memory])
# Store a memory with semantic embeddingsresult=agent.tool.mongodb_memory(
action="record",
content="User prefers vegetarian pizza with extra cheese",
metadata={"category": "food_preferences", "type": "dietary"},
)
# Search memories using semantic similarity (vector search)result=agent.tool.mongodb_memory(
action="retrieve",
query="food preferences and dietary restrictions",
max_results=5,
)
# List all memories with paginationresult=agent.tool.mongodb_memory(action="list", max_results=10)
# Get specific memory by IDresult=agent.tool.mongodb_memory(action="get", memory_id="mem_1234567890_abcd1234")
# Delete a memoryresult=agent.tool.mongodb_memory(action="delete", memory_id="mem_1234567890_abcd1234")
# Single-tenant: use the standalone tool with configuration from environment variablesagent=Agent(tools=[mongodb_memory])
result=agent.tool.mongodb_memory(action="record", content="User prefers vegetarian pizza")

🌍 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_NON_INTERACTIVERun tools without interactive prompts, set to "true" to suppress confirmation dialogsfalseTools with a confirmation prompt (e.g. shell, 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

Tavily Search, Extract, Crawl, and Map Tools

Environment VariableDescriptionDefault
TAVILY_API_KEYTavily API key (required for all Tavily functionality)None

Exa Search and Contents Tools

Environment VariableDescriptionDefault
EXA_API_KEYExa API key (required for all Exa functionality)None

Mem0 Memory Tool

Security Model: The tenant-isolation keys (user_id / agent_id) are never exposed as agent-facing tool parameters. The agent only chooses the action and its content/query/memory_id. This prevents a model (or prompt-injected content) from reading, writing, or deleting another tenant's memories.

Usage patterns:

fromstrandsimportAgentfromstrands_tools.mem0_memoryimportMem0MemoryTool, mem0_memory# Multi-tenant (recommended): bind identity per authenticated principaltool=Mem0MemoryTool(user_id=f"user_{authenticated_user_id}")
agent=Agent(tools=[tool.mem0_memory])
agent.tool.mem0_memory(action="store", content="User prefers vegetarian pizza")
# Single-tenant: use the standalone function with env vars (MEM0_USER_ID / MEM0_AGENT_ID)agent=Agent(tools=[mem0_memory])
agent.tool.mem0_memory(action="store", content="User prefers vegetarian pizza")

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
  4. Neptune Analytics (Optional Graph backend for search enhancement):

    • Uses Neptune Analytics as the graph store backend to enhance memory recall.
    • Requires AWS credentials and Neptune Analytics configuration
    # Configure your Neptune Analytics graph ID in the .env file:
    export NEPTUNE_ANALYTICS_GRAPH_IDENTIFIER=sample-graph-id
    # Configure your Neptune Analytics graph ID in Python code:
    import os
    os.environ['NEPTUNE_ANALYTICS_GRAPH_IDENTIFIER'] = "g-sample-graph-id"
    
Environment VariableDescriptionDefaultRequired For
MEM0_USER_IDUser ID for memory operations (standalone function)NoneStandalone
MEM0_AGENT_IDAgent ID for memory operations (standalone function)NoneStandalone
MEM0_API_KEYMem0 Platform API keyNoneMem0 Platform
OPENSEARCH_HOSTOpenSearch Host URLNoneOpenSearch
AWS_REGIONAWS Region for OpenSearchus-west-2OpenSearch
NEPTUNE_ANALYTICS_GRAPH_IDENTIFIERNeptune Analytics Graph IdentifierNoneNeptune Analytics
DEVEnable development mode (bypasses confirmations)falseAll modes
MEM0_LLM_PROVIDERLLM provider for memory processingaws_bedrockAll modes
MEM0_LLM_MODELLLM model for memory processinganthropic.claude-3-5-haiku-20241022-v1:0All modes
MEM0_LLM_TEMPERATURELLM temperature (0.0-2.0)0.1All modes
MEM0_LLM_MAX_TOKENSLLM maximum tokens2000All modes
MEM0_EMBEDDER_PROVIDEREmbedder provider for vector embeddingsaws_bedrockAll modes
MEM0_EMBEDDER_MODELEmbedder model for vector embeddingsamazon.titan-embed-text-v2:0All 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)
  • If NEPTUNE_ANALYTICS_GRAPH_IDENTIFIER is set, the tool will configure Neptune Analytics as graph store to enhance memory search
  • LLM configuration applies to all backend modes and allows customization of the language model used for memory processing

Bright Data Tool

Environment VariableDescriptionDefault
BRIGHTDATA_API_KEYBright Data API KeyNone
BRIGHTDATA_ZONEBright Data Web Unlocker Zoneweb_unlocker1

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
PYTHON_REPL_INTERACTIVEWhether to enable interactive PTY modeNone
PYTHON_REPL_RESET_STATEWhether to reset the REPL state before executionNone
PYTHON_REPL_PERSISTENCE_DIRSet Directory for python_repl tool to write state fileNone

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
EDITOR_DISABLE_BACKUPSkip creating .bak backup files during edit operationsfalse

Environment Tool

Environment VariableDescriptionDefault
ENV_VARS_MASKED_DEFAULTMasking of values whose name contains TOKEN, SECRET, PASSWORD, KEY, or AUTH. Set to false to disable. This is the only way to configure masking: the agent cannot override it through tool input, and the environment tool cannot set it. Tools that execute arbitrary code in the agent process, such as python_repl and shell, can still write ittrue

HTTP Request Tool

Environment VariableDescriptionDefault
STRANDS_HTTP_ALLOW_INSECURE_SSLAllow disabling SSL certificate verification via verify_ssl parameterfalse

Dynamic MCP Client Tool

Environment VariableDescriptionDefault
STRANDS_MCP_TIMEOUTDefault timeout in seconds for MCP operations30.0

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

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

RSS Tool

Environment VariableDescriptionDefault
STRANDS_RSS_MAX_ENTRIESDefault setting for maximum number of entries per feed100
STRANDS_RSS_UPDATE_INTERVALDefault amount of time between updating rss feeds in minutes60
STRANDS_RSS_STORAGE_PATHDefault storage path where rss feeds are stored locallystrands_rss_feeds (this may vary based on your system)

Retrieve Tool

Environment VariableDescriptionDefault
RETRIEVE_ENABLE_METADATA_DEFAULTDefault setting for enabling metadata in retrieve tool responsesfalse

Use Agent Tool

Environment VariableDescriptionDefault
STRANDS_PROVIDERDefault model provider when using model_provider="env"ollama
STRANDS_MODEL_IDDefault model identifier for environment-based model selectionNone
STRANDS_MAX_TOKENSMaximum tokens for the nested agent modelNone
STRANDS_TEMPERATURESampling temperature for the nested agent modelNone

Elasticsearch Memory Tool

Environment VariableDescriptionDefault
ELASTICSEARCH_CLOUD_IDElasticsearch Cloud ID for connectionNone
ELASTICSEARCH_URLElasticsearch URL for serverless connectionNone
ELASTICSEARCH_API_KEYElasticsearch API key for authenticationNone
ELASTICSEARCH_INDEX_NAMEElasticsearch index name for memory storagestrands_memory
ELASTICSEARCH_NAMESPACENamespace for memory isolationdefault
ELASTICSEARCH_EMBEDDING_MODELAmazon Bedrock model for embeddingsamazon.titan-embed-text-v2:0
AWS_REGIONAWS region for Bedrock embedding serviceus-west-2

Note: This tool requires AWS account credentials to generate embeddings using Amazon Bedrock Titan models.

Graph Tool

The graph tool uses the same model provider environment variables as use_agent for per-node model configuration. No additional environment variables are required.

Video Tools

Environment VariableDescriptionDefault
TWELVELABS_API_KEYTwelveLabs API key for video analysisNone
TWELVELABS_MARENGO_INDEX_IDDefault index ID for search_video toolNone
TWELVELABS_PEGASUS_INDEX_IDDefault index ID for chat_video toolNone

MongoDB Atlas Memory Tool

Environment VariableDescriptionDefault
MONGODB_ATLAS_CLUSTER_URIMongoDB Atlas connection stringNone
MONGODB_DATABASE_NAMEDatabase name for MongoDB operationsstrands_memory
MONGODB_COLLECTION_NAMECollection name for MongoDB operationsmemories
MONGODB_NAMESPACENamespace for memory isolationdefault
MONGODB_EMBEDDING_MODELAmazon Bedrock model for embeddingsamazon.titan-embed-text-v2:0

Note: This tool requires AWS account credentials to generate embeddings using Amazon Bedrock Titan models.

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!

Stay in touch with the team

Come meet the Strands team and other users on Discord

License

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

Security

The tools in this repository are experimental and are provided as-is. Any production use should be preceded by an independent security review of the specific tools you enable.

For guidance on building and deploying agents safely, see Responsible AI in the Strands Agents documentation.

To report a security issue, 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