GuideBeginner

Agent Fundamentals And Tool Calling

This is the foundation of the whole agentic engineering ecosystem: it teaches, from scratch, what an AI agent is and how tool calling actually works. You build an agent for Reservo (a coworking room booking system) with four canonical tools — `list_rooms`, `get_quote`, `book_room`, `cancel_booking` — and use that case to take apart the line between an LLM that only answers and an agent that acts: the tool contract in JSON Schema, the real `tool_use`/`tool_result` protocol of Claude's Messages API, the agent loop (`while`) that asks-executes-feeds-repeats with an iteration cap, selecting among multiple tools with parallel tool calls, managing state inside the loop, and error robustness with retries and timeouts. The engineering (the tools, the loop runner, dispatching, retries) actually runs on Python 3.14 with real cited output; the model's decision is honestly treated as a concept (realistic examples with `claude-sonnet-5`), verified against the official Claude documentation. This is not a tutorial for any particular framework — the patterns it teaches are the same with any of them.

64
lessons
8
modules
English · Spanish
available in
Yes
certificate
Free
access
NIEVA

Outcomes

What you'll be able to do

  • Precisely distinguish an LLM+prompt (a pure text-to-text function) from an agent (an LLM with tools that takes actions in a loop)
  • Write a tool's complete contract — `name`, `description`, `input_schema` in JSON Schema (types, `required`, `enum`) — and design scoped tools with a single responsibility
  • Reproduce the exact shape of Claude's Messages API tool-calling protocol: the `tool_use` block (`id`, `name`, `input`) and the `tool_result` block (`tool_use_id`, `content`), verified against the official documentation
  • Build the agent loop (`while`): ask the model, execute the tool if needed, feed the result back into the history, repeat until `end_turn`, with an iteration cap that prevents infinite loops
  • Chain several tools in a multi-step task (`list_rooms` → `get_quote` → `book_room`), using one step's observation to decide the next
  • Declare multiple tools at once, disambiguate similar tools, and run parallel tool calls with real threads, measuring the cost of an oversized tool set
  • Ground the agent's final answer in what the tools actually returned, and detect when a response isn't grounded
  • Manage state and context inside the loop: the history as working memory, the finite context window, summarizing long results, and passing data (like a `booking_id`) from one step to the next
  • Handle tool failures: return the error as a `tool_result` with `is_error`, validate arguments, retry only transient failures with a cap, and apply timeouts with graceful degradation
  • Assemble the complete Reservo agent by integrating tools, protocol, loop, multi-tool selection, state, and robustness into a single system that solves a real multi-step task

Before you start

What you need to bring

It's for you if...

  • Developers who want to understand what an AI agent is and how tool calling works from first principles, without relying on a framework
  • Backend developers who will build agents on top of the Claude API (or any LLM with tool calling) and need the right mental model before reaching for an SDK
  • Developers who've already used an agent framework (LangChain, etc.) and want to understand what happens underneath the tool contract and the loop
  • Anyone preparing for the rest of the agentic ecosystem — memory, multi-agent orchestration, MCP, RAG, context engineering — who needs this foundation first

Requirements and materials

  • Basic Python: functions, dictionaries, `if`/`else`, exception handling (`try`/`except`)
  • Having used an AI assistant (ChatGPT, Claude) as a user at least once, for the "prompt → response" intuition
  • Python 3.14 installed with its standard library; no API key or internet connection required — all the engineering runs locally

Content

The syllabus, module by module

Open any of them to see its lessons.

Common questions

What people usually ask

Start whenever you like

Reviews

What students say

These reviews are from enrolled students who completed at least 50% of the course. We moderate reviews only on content grounds (spam, offensive language, personal data), never for being critical or negative.

No approved reviews yet.

Be the first to share your experience!