Add tools to your agent
Give your agent the ability to do things beyond generating text: call an API, read a file, run code, or query a database. You pass tools to an agent, and the agent decides when to call them based on the request. Strands works with tools you write yourself, prebuilt tools the SDK and community ship, and any MCP server.
Give your agent tools
Section titled “Give your agent tools”Prebuilt tools and how they run
Section titled “Prebuilt tools and how they run”A running agent with a tool
Section titled “A running agent with a tool”The smallest useful setup is an agent with a single tool it can decide to call. Define the tool, pass it to the agent, and invoke:
from strands import Agent, tool
@tooldef get_weather(city: str) -> str: """Get the current weather for a city.""" return f"It's sunny in {city}."
agent = Agent(tools=[get_weather])agent("What's the weather in Seattle?")import { Agent, tool } from '@strands-agents/sdk'import { z } from 'zod'
const getWeather = tool({ name: 'get_weather', description: 'Get the current weather for a city', inputSchema: z.object({ city: z.string().describe('The name of the city'), }), callback: (input) => `It's sunny in ${input.city}.`,})
const agent = new Agent({ tools: [getWeather] })await agent.invoke("What's the weather in Seattle?")The agent reads the tool’s description and decides when to call it. From here you add the tools your application needs and control how they run.
Where to go next
Section titled “Where to go next”New to tools? Start with Attach and invoke tools to see how tools load onto an agent and the two ways to call them, then Create custom tools to build your own.
Bringing in tools that already exist? Reach for vended tools or the community tools package, or connect an MCP server. When a model returns several tool calls at once, tool executors decide whether they run concurrently or in order.