Tool calling lets a model request external information or actions when a prompt needs real-time or specialized data. The application executes the request and returns its result for the model to use in its response. section 4.4 section 4.4.1
Figure 4.14 The process of tool calling in an AI-powered application using the Vercel AI SDK. This shows how a user action initiates a prompt, which is formatted by the SDK and sent to the AI provider. The AI model may request a tool call, which is then executed by the SDK. The tool’s response is fed back to the AI model through the SDK, and finally, the result is used to update the UI for the user.
Follow the request from the user through the model and SDK, then back to the model and the interface. Tool execution stays under application control. section 4.4.1
Weather lookup
A model can request weather data for a region, receive the result, and incorporate it into an answer. An alternative is to insert fetched weather data directly into a prompt; this works best with a consistent prompt format and offers less flexibility. section 4.4 section 4.4.1












