Tools and function calling

Home Learn Tools and function calling

In short

Tool calling lets an AI assistant request a specific function, such as looking up an approved record. The application decides whether to run it and returns the result. The model’s request is a proposal, not permission.

Why it matters

An assistant that only writes text can still mislead you, but an assistant connected to software can also affect a system. The distinction matters when a tool retrieves information, saves a draft, or sends something to another person. A useful design makes those actions separate and names their consequences.

How it works

A developer defines a tool’s name, purpose, and inputs. The application presents that description to the model. The model may respond with a request that supplies values for those inputs, such as a document identifier. The application checks the values, the requesting person’s access, and the current context. It then calls the underlying function and gives the result back to the model. The model can use that result in its answer, but it should not treat a tool error as proof of success.

This is similar to a normal software function call in that there is a defined interface. It differs because the model decides when and how to request it. Anthropic’s 2025 guidance on writing tools emphasizes clear names, focused functions, and responses that give the agent enough context. Its 2024 agent guide shows how tools can be combined in a loop. Neither guide makes the model an authorization service; the application has to enforce limits independently.

A bounded tool might return approved instructions for a selected item. A broad tool that can search every folder, change records, and send mail gives the model many more ways to make a consequential mistake. Separate read from write and draft from send. Use required fields and validation for each operation. Return an error that says what failed without exposing unrelated data. Log the tool chosen, the inputs it was allowed to use, and the outcome so a reviewer can reconstruct what happened.

Example

Illustrative example: this scenario is invented.

Nora, 42, is a nurse educator preparing a staff-room supply guide. She asks an assistant to find the public catalog description for a training mannequin. A read tool returns an item name and description. A separate draft tool proposes a supply-list entry. There is no purchase tool. When the catalog returns two similar models, the assistant shows both instead of choosing one from the name alone. Nora checks the model code before she uses the draft. The tool result helps her find information; it doesn’t make the selection for her.

What it doesn’t mean

A tool call isn’t evidence that the answer is correct. It may return old or ambiguous information. A carefully worded prompt cannot substitute for access checks. A tool that accepts a record ID should still confirm who may read that record. Also, giving the assistant a tool doesn’t require it to use that tool on every turn; the application should make the need and outcome inspectable.

Try it

Write three possible tools for a harmless public reading-list assistant: search a catalog, save a private draft, and post a public recommendation. Ask any AI assistant which inputs each tool should require and what should happen when a book title has several matches. Compare the consequences of each tool. Circle the one that should need your explicit approval before it runs.

Keep going

Sources

Share this page