Beginner-Friendly Topic
Take your time - it's perfectly normal to re-read this topic 2-3 times. Try the interactive code editor below to run code yourself. Use the Q&A section to check your understanding before moving on.You've got this!
Multiple Tools
Real agents use multiple tools in sequence. Each tool call produces an observation that feeds into the next decision. Combining tools allows agents to accomplish complex goals.
6 min•By Priygop Team•Updated 2026
Multi-Tool Workflow
Multi-Tool Workflow
# An agent using multiple tools in sequence
# Goal: Find a product, check its price, and email the result
def web_search(query: str) -> dict:
# Simulated search result
return {"status": "success", "results": [{"title": "Widget X", "id": "WX-100"}]}
def get_product_price(product_id: str) -> dict:
prices = {"WX-100": 49.99, "WX-200": 79.99}
price = prices.get(product_id)
if price:
return {"status": "success", "product_id": product_id, "price": price}
return {"status": "error", "error": f"Product {product_id} not found"}
def send_email(to: list, subject: str, body: str) -> dict:
print(f"[DRY RUN] Email to {to}: {subject}")
return {"status": "success", "sent_to": to}
# Step 1: Search
search_obs = web_search("Widget X price")
print("Step 1 - Search:", search_obs["results"][0]["id"])
# Step 2: Get price using result from step 1
product_id = search_obs["results"][0]["id"]
price_obs = get_product_price(product_id)
print("Step 2 - Price:", price_obs["price"])
# Step 3: Email the result
email_obs = send_email(
to=["user@example.com"],
subject="Widget X Price",
body=f"The price of Widget X is $" + str(price_obs['price'])
)
print("Step 3 - Email:", email_obs["status"])