Follow a tool request

Lesson 3 of 35 · Working with AI coding agents

A tool is a capability made available to the harness, such as reading a file or running a test. The model does not directly reach into a project simply by describing an action. It generates a structured tool request, which names an available tool and supplies its arguments. The harness checks and dispatches the request according to its rules; the tool returns a result. The harness can then include that result in a later model request.

Consider an imaginary request: “Find why the receipt total is missing.” A possible sequence is:

  1. The model requests a read of receipt.py through a file-reading tool.
  2. The harness checks whether that operation is permitted. If approved, the tool returns file contents; if denied or the path is wrong, it returns a denial or error instead.
  3. The model uses the returned evidence to propose a change. With an editing tool and permission, the harness may apply it.
  4. The model requests a test. The tool reports its output and status. The model explains what changed and what the test did or did not establish.

This is an illustrative sequence, not a transcript of a real run. The test might fail, be unavailable, or pass without covering the missing-total case. An agent may need several cycles, ask a question, or stop. A request to run a test is not evidence that it ran; a result is evidence of what the tool reported, not a guarantee that the system is correct.

Choosing a tool and limiting a run

A dedicated search tool may accept a directory, a pattern, and a result limit as separate fields. If implemented that way, its structured result can be easier to inspect and its permissions can be controlled separately from a general shell. The shell can handle tasks for which no dedicated tool exists, but it can also combine operations and invoke other programs. Neither interface is automatically complete, safe, or isolated: check the implementation, authority, and returned results.

Some hosts limit the number of model iterations in a run, sometimes called a step budget. An iteration may produce a response requesting one or several tool calls; the host decides what counts as a step. This limit is different from elapsed time and from a limit on individual tool calls. If it is exhausted, edits may exist while checks remain undone. Whether the host provides a final response, allows continuation, or resets the budget depends on its design; inspect the work and actual check results.

Running without a conversation on screen

Some agent applications can accept a single request in a noninteractive process, useful when another program starts the work. This does not remove tool permissions or side effects. If a required approval cannot be answered, the process might wait, fail, or deny the operation depending on its configuration; establish a safe approval policy before unattended use rather than bypassing it.

A process may send its main result to standard output (stdout) and progress or errors to standard error (stderr), but the exact stream and any structured event format are application-specific. Redirecting one stream may not capture the other. Check the exit status, actual event format, both streams, and any partial changes; output alone is not proof that the requested checks succeeded. Confirm the current application documentation before scripting around these details.

Tools can have real side effects. A write changes a file; a command can modify data or contact a service. Permissions, confirmation, and isolation reduce exposure but are not substitutes for reviewing the actual requested action and outcome. Read-only information can also include sensitive data or misleading instructions, so treat retrieved content as evidence to examine, not authority to obey.