AI coding and agents

Tool calling

Also known as Function calling, LLM tool use

By WeavePublished 1 min read

Definition

Tool calling is an interface in which a language model returns a structured request for an application-defined function or external action. The application validates and executes the tool, then supplies the result back to the model.

The model requests, the application acts

A model can decide that it needs a repository search or test execution and return the tool name with structured arguments. The surrounding application checks those arguments, applies permissions, runs the action, and sends the result back.

This division matters. A model's request is not proof that an action should occur. The application owns validation, authorization, error handling, and side effects.

An illustrative coding turn

An agent receives a failing test and requests a file search. The application limits the path, performs the search, and returns matching lines. The model then proposes an edit and requests a test command. Each tool result changes the context for the next decision.

Record the tool name, arguments, result status, timing, and task outcome. Redact secrets and avoid storing more source content than the investigation requires.

Evaluate decisions and execution

Measure whether the agent selected the right tool, supplied valid arguments, recovered from errors, and completed the task. A model that writes fluent explanations but repeatedly calls an unavailable tool is not effective in that workflow.

How this relates to Weave

Weave Router evaluates coding-agent requests that include tool use. Tool calls can change the task's cost, latency, and failure modes, so compare routed models on complete tool-using workflows rather than text responses alone.

Explore Router

Sources and further reading

  1. Tool use overview, Claude Platform Docs