ai.vostman.fi
← AI Glossary

Encyclopedia of AI

Tool calling: the model proposes, software executes

Tool calling, also called function calling, lets a language model request an operation through a structured interface. The model receives tool descriptions and argument schemas. It can then return a tool name and arguments instead of immediately producing the final answer.

For an application-defined tool, the surrounding software executes the function and returns its result to the conversation. The model can use that result to answer or request another operation. Some providers also offer hosted tools that execute inside their service.

The model generates a room-temperature request. Application code reads a sensor and returns the observation 21.4 degrees Celsius to the model.

Crossing the boundary

Suppose the user asks for the temperature of a room. The model might request read_temperature with the argument room: "office". Application code checks the request, reads the sensor and returns a value such as 21.4. The next model turn can explain that observation to the user.

The generated arguments are a request to run code, not evidence that code has run. A correct-looking JSON object proves neither execution nor success. The actual tool result supplies that missing observation.

Interfaces shape what the model can do

Clear names, descriptions and schemas help the model select a useful operation. A schema constrains the request's shape; the application still controls permissions and checks whether the requested operation is meaningful. Returning precise errors gives the model a chance to correct its next request.

A tool call can be part of a single answer or a repeated agent loop. RAG supplies retrieved evidence; tool calling provides a more general interface to search, computation, files or actions. The application determines the available capabilities.

Sources