Agents

Tool calling

Tool calling lets a model request a typed external operation.

AppModelToolprompt + schemascall get_weatherapp runs it31°Cresult
Tool calling lets a model request a typed external operation. Values shown in the worked visual are illustrative unless the labels state otherwise.

How it works

The model produces a tool name and structured arguments rather than directly performing the operation. The host validates, executes, and returns the result.

A concrete example

Illustrative: call weather({city: "Pune"}) and receive temperature 29 °C.

Do not confuse it with Function execution

the model proposes the call; the application actually executes it.

Study the full lesson