Lesson 17 — Multiple tools
Picking the right tool
Real agents have several tools and the model picks one per step. Here we have three:
- calculator — exact maths (models often get arithmetic wrong).
- clock — the date and time (a model does not know what day it is). We freeze the time in
NOWso the output is always the same. - lookup — searches a small glossary (a dict of terms and meanings).
The model picks by name; your registry decides what actually exists. If the model asks for a tool that is not registered, the agent answers with an error instead of crashing.
Watch out: never run model text with eval() — that would let the model (or anyone who tricks it) run any code. The calculator below splits "12 * 7" into parts and only knows four operators.
Why it matters: more tools means more useful agents — and more need for clear names and a strict registry.
Finish lookup(term) so it returns the glossary entry (or "not found"), and register it in TOOLS.
Run your code — when the output matches the task, you will see a green check. Then mark the lesson complete.
A quick 3-question quiz on this lesson — instant feedback.
Ready for more? Optional paid resources that pick up where this lesson leaves off.
Some links on this page are affiliate links: we may earn a commission at no extra cost to you. As an Amazon Associate I earn from qualifying purchases.
Project-based AI Agents Foundations courses if you want a structured paid path after the free lessons. Wait for a sale — prices drop often.
Browse on Udemy →Search Amazon for AI Agents Foundations books — check the publication year so the examples match current versions.
Search Amazon →