JJoeven

Curriculum

Tools & Function Calling

Simple tools from zero: schema, dispatch, idempotency, sandboxes, MCP, and permissions your runtime actually enforces.

  1. 01

    Why Tools

    Weights guess. Tools fetch, compute, and change the world. Agents need both.

    20 min
  2. 02

    Model vs Runtime

    The model proposes a name and arguments. Your code validates, runs, and logs. That split is the product.

    19 min
  3. 03

    Read vs Write Tools

    Getters observe. Writers change the world. Mix them and retries become incidents.

    21 min
  4. 04

    What Is Not a Tool

    A paragraph in a prompt is not a function. If the runtime cannot call it, it is fan fiction.

    18 min
  5. 05

    JSON Schema for Tools

    A tool is an API. JSON Schema is how you describe arguments the model may fill — and you must still validate.

    21 min
  6. 06

    Required Fields and Extra Keys

    Missing keys fail closed. Extra keys are how injection smuggles SQL. Reject both.

    19 min
  7. 07

    Descriptions Are Prompts

    The tool description is a docstring the model will obey poorly. Write when to use it, when not to, and which ids it accepts.

    20 min
  8. 08

    Function Calling

    The model returns a name plus arguments. You execute. You send the result back. That is the whole protocol.

    22 min
  9. 09

    The Dispatcher

    One table maps names to functions. Unknown names fail. Never run model text as code. Never import os because the model asked.

    20 min
  10. 10

    Coerce and Structured Errors

    Turn "17" into 17. Reject -1. Return error codes the model can use, not a 4,000-line traceback.

    19 min
  11. 11

    Parallel Tool Calls

    Several reads in one turn can run together. Two refunds of the same invoice cannot. Order and isolation matter.

    20 min
  12. 12

    Observations and Truncation

    Tool results go back as data, not as new policy. Cap size. Mark truncated. Never dump a 2 MB log into the next prompt.

    21 min
  13. 13

    Designing Tools

    Small, typed tools with boring errors beat a god function that takes a natural-language command.

    22 min
  14. 14

    Idempotency

    Agents retry. Networks retry. The model retries because it did not read the first observation. Same key, same result.

    21 min
  15. 15

    Timeouts, Retries, and Size Caps

    Hung tools must die. Huge outputs must truncate. Retry reads. Do not blindly retry writes.

    19 min
  16. 16

    Code Interpreters

    Let the model write Python for math — then run it in a tiny sandbox, not on your laptop as root.

    22 min
  17. 17

    Browser and Computer Use

    A page or a desktop is just state. Clicks, types, and screenshots are tools. Success is a predicate, not a vibe.

    21 min
  18. 18

    Model Context Protocol (MCP)

    MCP is a standard way to list and call tools on other servers — not a new brain and not a permission system.

    20 min
  19. 19

    MCP Host Policy

    The host decides which servers are on, which tools reach the model, and which calls are audited. “It’s MCP” is not a threat model.

    19 min
  20. 20

    Permissions and Least Privilege

    Allowlists, argument bounds, and tight credentials: the model proposes, the policy disposes.

    22 min
  21. 21

    Human Approval

    Irreversible calls enqueue for a human. Timeout is a deny. Silence is not consent.

    20 min
  22. 22

    Path and Host Allowlists

    read_file needs a folder jail. http_get needs a host allowlist. Check before you fetch, not after.

    21 min
  23. 23

    Identity and the Confused Deputy

    The bot’s credential is not the user’s authority. Check what Ada may do, not only what the process key can do.

    20 min
  24. 24

    Tool Fixtures and When Tools Fail

    Every tool needs a valid call, a missing field, and an extra key in CI. When the catalog is wrong, stop prompting and fix the functions.

    21 min
Start this track