Build Your First AI Agent from Scratch · 35 min · Python · httpx · Serper API
Building the Tool Layer
A tool is only as good as its description — the model can't read your code, only what you tell it the tool does.
Hiring signal: Tool design is the actual skill behind every production agent — the planning loop in Section 3 is comparatively mechanical. Engineers who can write a tool schema that reliably steers a model are the ones whose agents work outside the demo.
What you will learn
- Write a JSON Schema tool definition that reliably steers the model
- Implement and test 4 real tools in isolation, before any agent loop exists
- Diagnose why a model didn't call a tool by reading the tool's description, not the code
Introduction
Last lesson you saw the full request/tool_use/result cycle with one throwaway tool. Today you build the four tools your agent will actually use for the rest of the course: web_search, read_file, run_python, and fetch_url. You test every one of them with hardcoded input before the model ever sees them — if a tool doesn't work standalone, wiring it to an LLM only makes the failure harder to find.
The rule: test tools before the model touches them
It's tempting to write a tool and immediately let the agent call it, so you can "see it work end to end." Don't. If something breaks, you won't know whether the bug is in your tool, your schema, or the model's reasoning — three different problems that look identical from the outside. Every tool below gets a 3-line manual test with hardcoded arguments first.
The description is the entire interface
The model never sees your Python. It sees the name, description, and input_schema you wrote, and decides whether and how to call the tool based only on that. A tool with perfect code and a vague description will be ignored or misused. Write descriptions like you're onboarding a very literal new hire who can't ask clarifying questions.
Unlock the full lesson
You've read the first 2 sections. The rest of this lesson covers Tool 1 — `web_search`, Tool 2 — `read_file`, Tool 3 — `run_python`, Tool 4 — `fetch_url`, What You're Building — plus a hands-on lab, quiz, and project artifact.
Create a free account to unlock Phase 0 and Phase 1 of every course — no credit card.
Browse all courses · View pricing · DeVenture Academy