Tool use: from a proposed call to a checked result
Separate proposed actions from execution, validate arguments and permissions, and reason about retries and observations.
Preparation: basic arithmetic, units and structured data.
Plan 25–40 minutes with the activities; this is a study estimate, not a timed requirement. Both paths have complete narration. Your notes and progress are kept separately for each level.
FULL LOCAL NARRATION
Follow the complete explanation.
Narration includes worked solutions. Pause at each practice prompt before continuing. Formula notation has a spoken explanation; all teaching text remains readable.
A tool call is a proposal, not an accomplished action
High-school path. Separate proposed actions from execution, validate arguments and permissions, and reason about retries and observations. Preparation: basic arithmetic, units and structured data. Move between Signal Room, Workbench and Field Notes without losing your section. Pause before each worked solution.
A language model can propose using a calculator, searching a collection or creating a calendar item. The application decides whether and how to execute that proposal. Describing an action in text is not the same as performing it. A complete interaction includes a requested operation, validated arguments, execution, an observation and an answer that reflects the observation. This separation matters even for a calculator. If the application never runs the calculation, the model must not report a verified result. Our Workbench uses a local deterministic calculator and a simulated reservation ledger. It does not connect to an account or place a real reservation.
Worked example. The proposed request is to divide 24 by six. A text response saying “calculator returned four” is not evidence unless the calculator actually ran and its result was received. The Workbench records whether execution was reached and shows the returned value.
The displayed notation records the process described in the example. Keep its assumptions and units attached to the result.
Try it yourself. Who should enforce the allowed operation: only the text-generating model, or also the application executing the call?
Pause the narration and explain your reasoning before continuing to the worked solution.
Reveal worked solution
The application must enforce its own rules before execution. The model can help propose a suitable call, but a generated proposal cannot authorize itself. Keep execution status and returned evidence separate from the model’s description of what it intended.
Section 02 / 07
Write a small contract for arguments
A tool contract states the operation name, required fields, types and allowed values. Our calculator requires exactly the fields numerator and denominator, each a finite number, with denominator nonzero. The Workbench can send a valid numeric denominator, a numeric-looking string, or omit the field. A string containing “6” is not the same typed value as the number six. This fixture rejects it rather than silently converting it. Real tools may choose explicit coercion rules, but those rules should be documented. Syntactically valid structured data is only the first gate; the operation must also make sense and be permitted.
Worked example. Three candidate objects carry denominator values six, the string “6”, and no denominator. Under our strict contract only the first passes type and presence checks. Changing the interface to allow strings would change the contract, not make these cases equivalent automatically.
The displayed notation records the process described in the example. Keep its assumptions and units attached to the result.
Try it yourself. Can an object with all required numeric fields still describe the wrong calculation?
Pause the narration and explain your reasoning before continuing to the worked solution.
Reveal worked solution
Yes. The numerator and denominator may be swapped, use incompatible units, or refer to the wrong question. Structural validation checks shape and types. Semantic validation checks whether the operation is meaningful for the intended task.
Section 03 / 07
Keep units and numerical meaning attached
Calculators make arithmetic reproducible, but they cannot repair a wrongly framed question. Dividing 24 meters by six seconds gives four meters per second; dividing six by 24 answers a different question. A zero denominator is not an invitation to guess. The Workbench numerator ranges from zero to 48 and denominator from zero to 12. The result is available only when validation passes and tool use is allowed. A zero numerator with a nonzero denominator is a valid result of zero. Do not confuse that legitimate zero with a blocked calculation. The status trace explains which case occurred.
Worked example. Set numerator 24 and denominator six to obtain four. Set denominator zero and execution is rejected. Set numerator zero and denominator six and the result is zero with successful status. These last two runs must not share the same success flag.
24 meters / 6 seconds = 4 meters per second
The displayed notation records the process described in the example. Keep its assumptions and units attached to the result.
Try it yourself. Why is checking only whether the displayed numerical result equals zero insufficient?
Pause the narration and explain your reasoning before continuing to the worked solution.
Reveal worked solution
Zero can be a valid quotient, while a failed call may have no numerical result at all. Inspect the explicit status and observation. In our raw record, a missing result is null, and successful zero remains the number zero.
Section 04 / 07
Permission is separate from a valid request
A request can have perfect syntax and still be disallowed. Our permission control represents an application decision that is checked after argument validation and before execution. Turning permission off prevents the calculator from running. It is a teaching switch, not a real authentication service. For a real application, permissions should be tied to the user, operation and resource, and applied where the operation is executed. Reading information and changing something have different consequences. Asking an assistant for a draft does not automatically authorize sending that draft. The system should report the blocked status honestly instead of pretending the operation succeeded.
Worked example. With 24 and six, the arguments are valid. Permission zero makes the run stop before division; permission one allows it. In a calendar application, a similar boundary could allow reading free times while requiring separate authority to create a booking.
The displayed notation records the process described in the example. Keep its assumptions and units attached to the result.
Try it yourself. Does a tool response asking the assistant to perform another operation grant permission for that operation?
Pause the narration and explain your reasoning before continuing to the worked solution.
Reveal worked solution
No. A response is an observation to interpret under the existing task and permissions. It does not become a new user request or an authorization token simply because it came through a tool channel.
Section 05 / 07
Handle missing responses without duplicating effects
A timeout is ambiguous: the operation may have failed, or it may have succeeded while its response was lost. Retrying a read is often different from retrying a reservation or payment. Our ledger fixture starts empty on every run. The first valid reservation request always commits once, but its acknowledgement is deliberately lost. You choose zero, one or two retries. Without deduplication, every retry creates another entry. With a stable request key and server-side deduplication, retries return the original receipt. No real reservation is made. This experiment illustrates why “I did not receive success” does not mean “nothing happened.”
Worked example. Use two retries. Without a key, the first request and both retries produce three ledger entries. With deduplication, there is one entry and the later acknowledgements refer to it. With zero retries, one entry exists but the client still has no receipt.
The displayed notation records the process described in the example. Keep its assumptions and units attached to the result.
Try it yourself. After the first acknowledgement is lost, is immediately repeating a non-idempotent write always safe?
Pause the narration and explain your reasoning before continuing to the worked solution.
Reveal worked solution
No. The write may already have committed. Use an appropriate reconciliation or idempotency mechanism according to the service contract. Our example makes the hidden committed effect visible so you can compare it with what the client knows.
Section 06 / 07
Inspect observations and distinguish kinds of failure
A tool can return a usable value, a validation error, a denial, a temporary failure or an ambiguous outcome. These should not all become the same generic “something went wrong” message. Preserve enough structured information to choose a sensible next step. A missing required field suggests repairing the proposal. A denial suggests respecting the boundary or asking the authorized user. A timeout after a write calls for checking whether it committed. In the Workbench, the trace shows validation, permission and execution stages, while the ledger separately reports effects and receipt availability. This keeps environmental facts separate from the assistant’s confidence.
Worked example. Compare a missing denominator with a lost reservation receipt. The missing denominator means the calculator never executed. The lost receipt occurs after the simulated ledger committed. Both lack a usable response, but only one has a side effect to reconcile.
No observation ≠ no effect; explicit status guides recovery
The displayed notation records the process described in the example. Keep its assumptions and units attached to the result.
Try it yourself. What fact should an assistant communicate if it cannot confirm whether a write completed?
Pause the narration and explain your reasoning before continuing to the worked solution.
Reveal worked solution
It should report the uncertainty and the evidence available, rather than claim either success or failure without support. Then follow the service’s documented status-check or deduplication procedure within the authorized scope.
Section 07 / 07
Test the contract and the complete task
Test both successful and unsuccessful paths. For this module, include a normal quotient, a zero numerator, a zero denominator, a string value, a missing field and denied permission. For the ledger, compare all retry counts with and without a stable key. Then ask whether the final response states the result and status accurately. A tool can pass unit tests while an assistant calls it with the wrong numbers. Conversely, a good plan can fail because the tool is unavailable. Keep these failures distinct. Save an experiment record containing your prediction, settings and interpretation, then compare it with the visible trace.
Worked example. A student sets numerator zero, denominator six, numeric mode and allowed permission. The correct report is “executed, result zero.” A program that tests only the truthiness of the result may incorrectly report failure. This is a useful regression case.
End-to-end task quality includes selection, arguments, execution and reporting
The displayed notation records the process described in the example. Keep its assumptions and units attached to the result.
Try it yourself. If every calculator execution returns the correct quotient, has the entire assistant been proven reliable?
Pause the narration and explain your reasoning before continuing to the worked solution.
Reveal worked solution
No. You still need evidence that it selects the appropriate tool, supplies the intended arguments, respects permissions and accurately communicates observations. Correct execution is one stage of a larger task.
Final checkpoint. Does a lost response prove a write never happened? Option 1: Yes. Option 2: No; it may have committed. Option 3: Only after two retries.
Pause and choose an answer before continuing.
Reveal worked solution
Option 2 is correct. A missing receipt and an absent effect are different states.
WORKBENCH / PREDICT → TEST → EXPLAIN
Inspect exact numerical data
These are computed teaching fixtures. No remote AI model or GPU is called by the experiment.
CHECK YOUR UNDERSTANDING
Commit to an explanation.
Keep your learning record.
INTEGRATED CAPSTONE
Turn evidence into a cited briefing
Worked examples, local narration and connected experiments at your level.
Original worked examples and teaching text, grounded in these primary references. Numerical fixtures explain mechanisms; model quality and hardware performance require separate measurements. Both levels share key examples, with different explanations and checkpoints.