CodeRigor

COURSE / REAL PRACTICE

AI tool calling foundations

Build a deterministic Python tool-calling simulation with typed arguments, explicit permissions, structured results and a bounded feedback loop.

Lessons & exercises7 authored lessons3 units
Start with the first lesson.

Read the explanation and diagrams, then work through the practice. Your browser profile supplies your saved progress.

What you’ll work toward

Build and test a mock-model notes assistant with an allowlisted registry, argument and object permissions, bounded tool results, cancellation and explicit call/step limits. No LLM account or host command execution is required.

Read an explanation, inspect the diagrams and work through the available checks, debugging exercises and builds. Feedback and prerequisite links guide the next step.

Before you start

This course builds on these skills:

Individual lessons can add prerequisites. Your lesson progress shows your actual readiness.

A look inside the first lesson

A response can request a tool or finish

Python
import copy
raw = {'kind': 'call', 'id': 'c1', 'name': 'read_note', 'arguments': {'ids': ['a']}}
accepted = copy.deepcopy(raw)
accepted['arguments']['ids'].append('b')
print(raw['arguments']['ids'])

Your lesson sequence

Follow the same units and lessons in either view. Prerequisite links and your practice progress stay with each lesson.

UNIT 013 lessons Messages, arguments and dispatch
  1. LESSON 01.01

    A response can request a tool or finish

    Parse a small explicit response protocol, distinguish a call request from a final answer, and retain call identity without executing anything.

    Open lesson
  2. LESSON 01.02

    Tool arguments need explicit types and fields

    Validate exact required argument fields, reject extras, and distinguish Boolean values from integer arguments in Python.

    Open lesson
  3. LESSON 01.03

    Dispatch only registered and permitted tools

    Resolve calls through trusted registry metadata, enforce a separate allowlist, and validate arguments before any handler runs.

    Open lesson
UNIT 023 lessons Results, feedback and permissions
  1. LESSON 02.01

    Return bounded values and useful failure codes

    Normalize tool outcomes into JSON data, preserve request IDs, redact exception details, and enforce a UTF-8 byte budget on returned values.

    Open lesson
  2. LESSON 02.02

    A feedback loop with calls, steps and cancellation

    Feed tool results back to a mock model, stop on a final answer, and enforce distinct call and model-step budgets with cancellation before effects.

    Open lesson
  3. LESSON 02.03

    Argument validity is not document permission

    Apply semantic limits and exact object allowlists before reading a note, treating IDs and prompt text as data rather than paths or authority.

    Open lesson
UNIT 031 lesson Mock-model notes assistant
  1. LESSON 03.01

    Capstone: a mock-model assistant over permitted notes

    Compose the complete tool-calling application over a supplied notes snapshot, enforce permissions before searching or reading, and inspect a reproducible transcript.

    Open lesson