Logotype Sitevision Developer
Log in
Log in

Tool calling now supported in the AI SDK

We've added support for tool calling in the Sitevision AI SDK. This allows the model to call server-side functions in your apps to fetch data, perform logic, or interact with the Sitevision Public API while generating a response.

With tools, the model is no longer limited to the information contained in the prompt. Instead, it can dynamically request data from your application and use that information to answer the user’s question.

Published: 2026-03-18

What is tool calling?

Tool calling allows you to define functions that the model can invoke when it needs additional information.

Each tool describes:

  • What the tool does (description)
  • What input it expects (parameters defined using JSON Schema External link.)
  • What happens when it is called (execute)

When the model determines that a tool is relevant to the user's question, it generates a tool call with arguments. The SDK then runs the corresponding execute function and sends the result back to the model so it can continue generating the response.

Because the tool runs server-side, the Sitevision Public API is fully accessible inside the execute function.

In other words, the model isn't just answering questions anymore - it can actually use Sitevision.

Example

Below is a simplified example where a tool retrieves pages that were recently published.

js
const tools = [ { name: 'get_pages_published_recently', description: 'Get pages published recently. Use this when the user asks what pages were published recently.', parameters: { type: 'object', properties: { days: { type: 'integer', minimum: 1, maximum: 365, description: 'The number of days to look back.', }, }, required: ['days'], }, execute: ({ days }) => { const pages = getInformationAboutPages(days); return JSON.stringify(pages); }, }, ]; ai.streamText(appData.getNode('llm'), { messages, tools, });

Getting started

With tool calling, you can build assistants that are tightly integrated with your Sitevision data and applications. Read more in the AI SDK documentation.