Skip to content
Eldan.ai
Courses

FreeSeries, 5 lessons, 42 min

Tool Calling From Scratch

Write the agent loop by hand: tool contracts, validation, budgets and replay tests.

Free for newsletter readers: subscribe with your email on the first lesson and the series opens. No account needed.

Written by Eldan.

What you will learn

  • Describe a tool as a name, a description and a JSON Schema
  • Write a working agent loop in about thirty lines
  • Return validation errors the model can recover from
  • Bound a run with step, time and token budgets
  • Detect repeated calls and stop loops
  • Test the loop with a scripted model and no API key

5 lessons, in order

  1. Lesson 1: A tool is a contract

    Concept, 5 min

    Describe a tool as a name, a description and a JSON Schema, and design it for a model.

  2. Lesson 2: The agent loop in thirty lines

    Example, 8 min

    Write a working agent loop with a step limit and test it with a scripted model.

  3. Lesson 3: Validate arguments and return errors the model can use

    Exercise, 15 min

    Write an execute function that validates arguments and turns every failure into a result the model can recover from.

  4. Lesson 4: Budgets, loops and guards

    Concept, 7 min

    Bound a run with step, time and token budgets, detect repeated calls, and guard tools with side effects.

  5. Lesson 5: Trace every run and test the loop without a model

    Check, 7 min

    Record a trace for each run and test the loop with a scripted model and no API key.

Each lesson ends with a quick check. Save it to your review queue, and it comes back on a spaced schedule.

The Eval Habit, by email

Seven short lessons by email that take one feature of yours to a measured score and a check in CI. One lesson a day, free, no account needed.

A confirmation email comes first. Leave with one click from any lesson. Privacy

Free for newsletter readers: subscribe with your email on the first lesson and the series opens. No account needed.
Each lesson ends with a quick check. Save it to your review queue, and it comes back on a spaced schedule.