Free self-study · No account needed · Progress stays in this browser. Back it up before clearing site data or changing devices.

← All weeks

Agents, Skills, and MCP / Week 10

Tool Calling

Build a validated tool registry. Replace the supplied dispatcher with tested tools, asynchronous status, permission checks, and durable operation identity.

Your lessons

  1. 01

    Defining and registering tools

    60 minutes planned · 7 sections
    Start →
  2. 02

    Handling asynchronous tool operations

    60 minutes planned · 7 sections
    Start →
  3. 03

    Authorizing and deduplicating tool execution

    60 minutes planned · 7 sections
    Start →

// Put it into practice

A validated tool registry

  1. Download week10.py from a lesson's practice section. Follow its setup instructions before running it.
  2. Lesson 1: Register file search, structured lookup, and a bounded arithmetic evaluator without arbitrary code evaluation.
  3. Lesson 2: Simulate a mutation committed before its response is lost; query status before retrying.
  4. Lesson 3: Implement a refund simulator with a persistent operation key and approval record.
  5. Run the supplied assertions and record actual results; a simulated contract check does not certify real model quality.
Download week 10 Python lab ↓

Read the script’s setup instructions and run it on your own computer. The website does not execute code or verify your results.

// Independent work

W10-LAB

Week 10: A validated tool registry

Replace the supplied dispatcher with tested tools, asynchronous status, permission checks, and durable operation identity.

Extend the guided artifact rather than start a second project. Normal, malformed, timeout, uncertain-outcome, duplicate, denied, and changed-approval cases pass.

What to produce

  • A validated tool registry
  • Setup commands, data or generation procedure, versions, and recorded outputs
  • Acceptance results and a precise limitation

Check your work

  • Normal, malformed, timeout, uncertain-outcome, duplicate, denied, and changed-approval cases pass.
  • Each claimed execution is supported by actual saved output.
  • Fixture results and real model results are identified separately.
  • Setup and reproduction use the taught tools without private credentials.
Self-assessment rubric
Technical correctness · 35 points
Implementation or analysis follows the relevant technical mechanism and handles the stated case.
Evaluation and evidence · 30 points
Reproducible tests, appropriate baseline, and accurate interpretation.
Engineering quality · 20 points
Clear structure, safe boundaries, and usable reproduction instructions.
Explanation and reflection · 15 points
Explains tradeoffs, limitations, and next experiment with evidence.

// Retrieve before you reread

Week 10 knowledge check

Try all 6 questions. Check your answers, review the explanations, and retry whenever you like. Answers are checked on this device.

1. A tool accepts an integer result limit from 1 through 4. A caller submits True. In Python, which validation best enforces an actual integer?
2. A registered lookup receives valid arguments but returns a raw exception string instead of its promised result object. What should dispatch do?
3. A ticket-creation operation commits under key create-6, but the response is lost. Which recovery is safest?
4. A caller cancels its wait after a report was sent. Which statement is correct?
5. An approved 900-cent refund targets the original payment method. A request keeps the amount but selects an external destination. What should the executor do?
6. A caller knows another owner’s committed operation key. What must precede returning its stored result?

Next: week 11 →