Tool / function calling
The model doesn't take actions itself — it emits a structured request to call a tool, your code executes it, and the result goes back into context.
Lesson 2 of 4 · ⭐ Gap priority
An agent works perfectly in the demo, then hallucinates a tool call the first week it's live. The gap between those two moments is what this lesson is about.
Four concepts turn a single LLM call into something that can actually take action.
The model doesn't take actions itself — it emits a structured request to call a tool, your code executes it, and the result goes back into context.
A standard protocol for exposing tools and resources to a model consistently, instead of every integration inventing its own function-calling schema.
Retrieval-Augmented Generation — searching your own data at request time and injecting the relevant chunks into context, instead of relying on what the model memorized in training.
A test suite for a prompt or agent — a fixed set of inputs with expected properties of the output, run automatically whenever the prompt or model changes.
Three gaps account for most of the difference.
The model calls a tool with a plausible-looking but invalid argument — a wrong ID, a made-up parameter — and no error surfaces until something downstream breaks.
A demo has one happy path; production has retries, partial failures, and adversarial input the demo never exercised.
Without evals, a prompt or model change that silently breaks one case takes days to notice instead of failing a test in CI.
Look at the sanitized agent trace below, then work through both exercises.
Agent trace:
User: "Refund the customer's last order."
Tool call: refund_order(order_id="ord_9f8e7d")
Tool result: Error — order_id not found
(order_id was hallucinated; no real "last order" lookup
was ever called first)Answer in your head first, then click a question to reveal the answer.
Work through the sample agent trace and check each item off. Progress is saved in your browser.
These primers are a starting point. Read the primary sources to build real fluency.
What building this project taught me.
Agentic engineering in production — evals, RAG, MCP — was the #2 self-identified gap across Tom's job-hunting skills scan, right behind Cloud Native Essentials' top gap.
A model inventing a plausible-looking ID instead of calling a lookup tool first is one of the most frequently reported agentic failures in production systems — it is worth treating as a default risk, not an edge case.