Example: Adding a Calculator to Our Agent › The Problem We're Solving
Michael BrenndoerferJune 29, 20251 min read
AI Agent HandbookAll chapters Part 5 of 15Tool Use - Extending the Agent's Abilities
Example: Adding a Calculator to Our Agent › The Problem We're SolvingOne section · Sections in this chapter2 / 16 ↓
Sections in this chapter16
Remember this scenario from earlier? You ask your agent: "What's ?"
Without tools, the agent approximates:
Let me work through this:
1,234 × 5,678 = approximately 7,010,000
So the answer is about 7,010,000.The agent is guessing. The actual answer is . That's an error of over . Not acceptable if you're calculating costs, revenues, or anything that matters.
With a calculator tool, the agent will:
- Recognize this is a math problem
- Call the calculator with the expression
- Return the exact answer:
Let's build it.