Quest 14 of 15
Agents, tool use & API integration patterns
Developers wire LLMs to tools: function calling, structured outputs, retrieval, and simple agent loops with guardrails and cost controls.
Start here
This module builds on earlier parts, but every important idea is explained in context. Developers wire LLMs to tools: function calling, structured outputs, retrieval, and simple agent loops with guardrails and cost controls. As you read, connect each concept to the worked example and ask what a person must still decide.
Big idea
Developers wire LLMs to tools: function calling, structured outputs, retrieval, and simple agent loops with guardrails and cost controls.

Learn one idea at a time
Read, explore, then mark each idea when you can explain it.
Idea 1 of 8
Define each tool with a narrow purpose and strict JSON schema. Prefer read-only, least-privilege functions with validated enums and bounded values instead of exposing general SQL, shell, email, or filesystem access.
Choose a deep dive
Open the topics you want to explore. The detail stays folded until you need it.
Deep dive 1Agents amplify mistakes
A loop that calls SQL or email tools without validation can exfiltrate data — treat tool inputs like user input.

Deep dive 2Validate every tool arg
Set max_steps, timeout, and allowlist of tools per environment.

Deep dive 3Worked example: Agents, tool use & API integration patterns
Support agent loop keeps calling search with empty queries, burning tokens. A responsible response is: Add empty-query guard, step limit, and fallback to human. Correct. Use this case to separate what the technology contributes from what people contribute. The team should compare the intended outcome with a baseline where applicable, record important assumptions, and keep a clear route to correct or stop the process.

Deep dive 4Local check for Agents, tool use & API integration patterns
Ask whether the examples, data, and assumptions fit your school, company, or community. Generic demos often miss local names, laws, connectivity, and languages.
Deep dive 5Agents turn model text into actions
Validate every tool argument, enforce least privilege, limit steps and cost, and require confirmation before consequential side effects.

One-minute challenge
Connect this lesson to real life
Name one situation where this idea could help, and one thing a person should still check.
Explore a real-world example
Use the arrows to connect the idea to a visible situation.
Photo example
Tool loop
User → LLM → tool call → validated execute → result → LLM → answer.

Key terms
Tap a term to flip and read the definition.
Optional further learningFree textbooks and trusted online resources
These sources informed the course structure. Use them to revisit a concept or study it in more depth.
Ready check
Tick each idea only when you could explain it without looking back.
Ready for practice? Build a two-tool agent: search docs + summarise with max 3 steps.
Extra context (audience, logistics, curriculum notes)
Built for: Software developers and technical learners — Python and coding required.
Formats: Learn scroll · Practice interactions · Quiz · Optional chat lab
Module 14 — Agents, tool use & API integration patterns
Next up
Ready for the next part?
When you've finished the reading, inline exercises, and knowledge check for this part, check the box to continue.