Server-Side Tools
Server-side tools are the simplest way to give models additional capabilities. They run entirely on the Portal API — your app doesn’t need to handle tool execution at all.
How It Works
When you send a message with server tools enabled, the model decides whether to call a tool like web search. The API executes the tool internally, the model sees the result and continues generating, then you receive the final response. Even though tool execution happened in the middle, the response arrives as one streaming response.
Common server tools include web search and image generation. Check out the full list of server tools for all available options.
Usage
Specify which tools to enable by name when sending a message through useChat or useChatStorage:
await sendMessage({
content: "Search for latest AI news",
model: "gpt-4o-mini",
serverTools: ["web_search"],
});To fetch available tools dynamically at runtime, use useTools.