Chapter C49 · Interactive Course

From a request to a tool result

APIs, tools, schemas, proposals, results and failure classes.

Start chapter in web app

Core Learning Concept

Follow the tool exchange from definition to proposed call, validation, authorization, execution, and result. Match each result to its call, then choose a repair based on the failure type. Keep format validity separate from correct values and completed external actions.

What You’ll Learn in This Chapter

  1. An API is a software interface

    Activity 1 of 8 · 4 min

    Recognize a programmatic request to another system.

    An Application Programming Interface defines how software programs communicate with services. Its structured contract specifies required request parameters and expected responses, letting programs invoke remote capabilities reliably without human interfaces.

    Start activity →

  2. A tool makes an action available to the agent

    Activity 2 of 8 · 4 min

    Identify a callable capability exposed by a host.

    A tool exposes an operation an agent host can execute, such as searching files or creating an event. The model can request that operation using its declared interface. Merely describing a desired action in text does not prove that the tool exists, was called, or completed successfully.

    Start activity →

  3. A schema describes acceptable arguments

    Activity 3 of 8 · 3 min

    Read required fields in a small tool contract.

    A schema specifies the required fields, datatypes, and structure for tool calls. Automatic schema validation rejects missing or malformed inputs prior to execution, preventing invalid requests from reaching external systems.

    Start activity →

  4. A tool call is a proposal to execute

    Activity 4 of 8 · 4 min

    Distinguish generated arguments from application execution.

    A model’s tool call specifies an operation and arguments for the host to process. The host may validate, authorize, execute, or reject it according to the system’s design. Follow that boundary in the diagram: producing a call and performing its requested side effect are separate events.

    Start activity →

  5. Results return to the next step

    Activity 5 of 8 · 4 min

    Follow a call-result-response loop.

    A tool result reports what happened for a particular call, commonly linked by an identifier. The agent can use it to decide the next step or compose a reply. An empty search result or error is information that should shape the answer, not a gap to fill with an invented success.

    Start activity →

  6. Structured output is a format promise

    Activity 6 of 8 · 4 min

    Separate schema validity from truthful content.

    Structured output constrains a response to an expected format, with guarantees depending on the feature and failure conditions. A valid JSON object can still contain an incorrect date or unsupported claim. Handle refusals, incomplete responses, and validation errors, then check the contents against the task.

    Start activity →

  7. Different failures need different repairs

    Activity 7 of 8 · 4 min

    Classify invalid input, denied access and temporary outage.

    Different failure modes require distinct responses. Malformed inputs need syntax corrections, missing permissions need authorization, and temporary outages warrant bounded retries. Never retry side-effecting operations blindly without checking external system state first.

    Start activity →

  8. Complete the tool loop

    Activity 8 of 8 · 5 min

    Arrange a tool definition, arguments, permission decision, returned error and corrected next action into a coherent trace.

    Start activity →