Local-first coding agents

AI Agent Tool Calling: How Coding Agents Read, Search, and Change Code

Understand AI agent tool calling, from structured tool requests to permission checks, results, retries, and developer review in a coding workflow.

AI agent tool callingcoding agent toolsLLM tool useagent function calling

Tool calling gives an agent evidence

Tool calling is a structured request from a model to software that can perform a specific action. For coding work, that might be reading a file, listing a directory, searching for a symbol, checking a Git diff, or running a test command.

The model does not execute arbitrary code by itself. It proposes a tool name and arguments. The harness validates that request, checks policy, runs the implementation if permitted, and returns a result the model can use for its next step.

Good tool design keeps boundaries explicit

Each tool should have a clear schema, a narrow description, and a predictable result. Read-only tools are useful for Chat and planning. Mutating tools, such as file writes and terminal commands, need stronger policy checks because they can change a workspace.

  • Validate arguments before execution.
  • Separate read-only and mutating capabilities.
  • Show requested actions and results in the activity stream.
  • Stop or retry safely when a tool fails.

The developer remains part of the loop

Useful tool calling is not invisible automation. It should show what was read, searched, changed, or run, then preserve the normal review process with diffs and tests. That gives an agent enough evidence to help without turning the workspace into a black box.

Truss exposes tool activity and keeps Chat and Plan non-mutating. Agent mode is where permitted workspace changes and commands can happen under the selected policy.

Next steps

Put it to work in your own workspace.

Pick the surface that fits your day, then connect a model you control.

FAQ

Questions developers ask before switching.

Is tool calling the same as function calling?

They are closely related. Function calling usually describes the structured model output; tool calling includes validation, policy, execution, results, and the next agent step.

Can tool calling make a coding agent safer?

Yes, when tools are narrow, arguments are validated, sensitive actions require approval, and the user can see what the agent requested and what happened.