Define tools for your AI chat with assistant-ui toolkits and the "use generative" directive, covering frontend, backend, human, provider, and external tools, registration with Tools(), and type safety.
A tool is a function the model can call to fetch data, call an API, drive your UI, or ask the user for input. In assistant-ui you declare tools in a toolkit: a named map where each key is the tool name the model sees and each value describes the tool's schema, where it runs, and how its call renders in the chat.
This is the canonical page for authoring tools. For the rendering side, see Tool UI. For wiring a toolkit into your server, see Backend tools. For MCP servers, see MCP.
The page runs from the first working tool to the reference material: a quick start, the kinds of tool, rendering, organizing and options, then how a toolkit compiles and registers, and troubleshooting. Samples call placeholder helpers such as fetchWeatherAPI, geocodeLocation, SearchResults, and DatePicker; implement them for your app.
Define tools with "use generative"
A "use generative" file is a single module that holds a tool's schema, its executor, and its renderer together. A build plugin splits it into a server build (schema and backend executors) and a client build (schema, renderers, and browser executors), so a backend execute never reaches the browser and a render never reaches your server.
A generative file follows four rules:
"use generative"is the first statement of the file. Only comments may precede it.- The default export is
defineToolkit({ ... })ordefineMcpToolkit({ ... }). - Every tool is an inline object literal that declares an
execute. Spreads the compiler can see, such as...defineMcpToolkit(...), and generative entries such asgenerative.present()are the exceptions. - You never write
type. The compiler infers the tool kind fromexecuteand writes it back.
For tools that execute somewhere else, use defineMcpToolkit({ ... }) for MCP servers or execute: externalTool() to attach a renderer to a tool another system defines.
Quick start ("use generative")
This quick start adds one browser tool to an app that already has an AI SDK chat: an AssistantRuntimeProvider with useChatRuntime and a /api/chat route. If you do not have one yet, start with the AI SDK guide.
Add the build plugin
The directive does nothing without a compiler. Install the plugin for your bundler and add it to its config:
npm install @assistant-ui/nextWrap your Next.js config with withAui:
import { withAui } from "@assistant-ui/next";
export default withAui({
/* ...your Next config... */
});Restart the dev server after changing the config. Turbopack caches loader output, so if a change to the plugin does not take effect, clear .next.
npm install @assistant-ui/viteAdd the aui() plugin:
import { defineConfig } from "vite";
import { aui } from "@assistant-ui/vite";
export default defineConfig({
plugins: [aui()],
});aui() runs before the React plugin on its own, so its position in plugins does not matter.
npm install @assistant-ui/metroWrap your Metro config with withAui:
const { getDefaultConfig } = require("expo/metro-config");
const { withAui } = require("@assistant-ui/metro");
module.exports = withAui(getDefaultConfig(__dirname));For a bare React Native app, import getDefaultConfig from @react-native/metro-config instead of expo/metro-config. In a React Native app, import defineToolkit from @assistant-ui/react-native.
Write the toolkit
Each tool is an inline object literal with a parameters schema, an execute, and a render (or renderText):
"use generative";
import { defineToolkit } from "@assistant-ui/react";
import { z } from "zod";
export default defineToolkit({
get_weather: {
description: "Get current weather for a location.",
parameters: z.object({
location: z.string().describe("City name or zip code"),
unit: z.enum(["celsius", "fahrenheit"]).default("celsius"),
}),
execute: async ({ location, unit }) => {
"use client";
return fetchWeatherAPI(location, unit);
},
render: ({ args, result }) => {
if (!result) return <div>Fetching weather for {args.location}…</div>;
return (
<div className="weather-card">
<h3>{args.location}</h3>
<p>
{result.temperature}° {args.unit}
</p>
<p>{result.conditions}</p>
</div>
);
},
},
});The inner "use client" inside execute marks this as a frontend tool: its executor runs in the browser. Omit it to run on the server; see Tool kinds.
Info
Zod Mini schemas carry no JSON Schema converter of their own, so convert them
with the module-level toJSONSchema before passing them as parameters. The
wrapped value still carries ~standard, so execute arguments stay typed:
import * as zm from "zod/mini";
// inside defineToolkit({ ... })
parameters: zm.toJSONSchema(zm.object({ location: zm.string() })),Register the toolkit
Add config to the runtime provider you already have: import the toolkit and pass it through Tools. Set sendAutomaticallyWhen on the runtime too, because a browser tool finishes after the response ends and the AI SDK runtime sends the result back only when this predicate returns true. Without it the chat stops after the tool runs.
"use client";
import { AssistantRuntimeProvider, AuiConfig, Tools } from "@assistant-ui/react";
import { useChatRuntime } from "@assistant-ui/ai-sdk";
import { lastAssistantMessageIsCompleteWithToolCalls } from "ai";
import toolkit from "./toolkit";
export function MyRuntimeProvider({ children }: { children: React.ReactNode }) {
const runtime = useChatRuntime({
sendAutomaticallyWhen: lastAssistantMessageIsCompleteWithToolCalls,
});
const config = AuiConfig({ tools: Tools({ toolkit }) });
return (
<AssistantRuntimeProvider runtime={runtime} config={config}>
{children}
</AssistantRuntimeProvider>
);
}useChatRuntime() targets /api/chat by default. To point at a different endpoint or customize requests, see Custom transport. For what Tools registers and where to mount it, see Registering a toolkit. For the two loops that continue a conversation after a tool call, see Multi-step tool calls.
Expose the toolkit to the model on your server
The same import resolves to the server build inside a route handler. Wrap it in an AISDKToolkit so the model is configured with every tool's schema:
import { AISDKToolkit } from "@assistant-ui/ai-sdk";
import { streamText, convertToModelMessages, stepCountIs } from "ai";
import { openai } from "@ai-sdk/openai";
import toolkit from "../../toolkit";
const aiToolkit = new AISDKToolkit({ toolkit });
export async function POST(req: Request) {
const { messages, tools } = await req.json();
const aiSDKTools = await aiToolkit.tools({ frontend: tools ?? {} });
const result = streamText({
abortSignal: req.signal,
model: openai("gpt-6-luna"),
messages: await convertToModelMessages(messages, { tools: aiSDKTools }),
tools: aiSDKTools,
stopWhen: stepCountIs(10),
});
return result.toUIMessageStreamResponse();
}stopWhen lets the model read the result of a server tool, such as a backend tool or an MCP tool, and keep going in the same request; the AI SDK runs a single step without it. The weather tool above runs in the browser, so this route needs stopWhen as soon as you add a server tool. See Multi-step tool calls, and Backend tools for the full server setup.
Tool kinds
Pick the kind by where the work happens and who supplies the result. In a "use generative" file you never write the kind: the compiler infers it from execute. Backend tools shows how each kind reaches the model.
| You want to… | Use | Runs in |
|---|---|---|
| Query a database or call an API with a secret | Backend tool: plain execute | Your server |
| Use browser APIs or read client state | Frontend tool: execute with "use client" | The browser |
| Change React component state | Tool stub: stubTool() plus useAuiToolOverrides | The browser, inside your component |
| Have the user confirm, choose, or fill in something | Human tool: humanTool() | The user, through render |
| Use a capability the model provider hosts, such as web search | Provider tool: providerTool({ … }) | The model provider |
| Render calls to a tool another backend or LangGraph node defines | External tool: externalTool() | Elsewhere |
| Expose the tools of an MCP server | defineMcpToolkit | The MCP server |
A frontend tool that sometimes needs a decision from the user can pause with human() instead of becoming a human tool; see Cancellation and execution context.
Backend tools
Run on your server. Author a plain execute (no "use client"); the compiler moves it to the server build and keeps only the schema and render on the client. A backend tool can still carry a render to show its call as a trace:
geocode_location: {
description: "Geocode a location name into latitude/longitude.",
parameters: z.object({ query: z.string() }),
execute: async ({ query }) => geocodeLocation(query),
render: GeocodeToolUI,
},Frontend tools
Run in the browser. Author a real execute with a leading "use client":
copy_to_clipboard: {
description: "Copy text to the user's clipboard.",
parameters: z.object({ text: z.string() }),
execute: async ({ text }) => {
"use client";
await navigator.clipboard.writeText(text);
return { copied: true };
},
renderText: {
running: "Copying text…",
complete: "Copied text to clipboard",
},
},The result reaches the model only if the client sends another request. Set sendAutomaticallyWhen on the runtime, as in the quick start.
Human tools
Pause the run until the user supplies a result through the rendered UI. Author execute: humanTool() and a render that calls addResult exactly once:
select_date: {
description: "Ask the user to select a date.",
parameters: z.object({ prompt: z.string() }),
execute: humanTool(),
render: ({ args, result, addResult }) => {
if (result) return <p>Selected {result.date}</p>;
return (
<DatePicker
prompt={args.prompt}
onChange={(date) => addResult({ date })}
/>
);
},
},humanTool is imported from @assistant-ui/react. Human tools render standalone unless they set display: "inline". The user's answer reaches the model only if the client sends another request, so set sendAutomaticallyWhen on the runtime, as in the quick start. See Tool UI for the full pattern.
Provider tools
Executed by the model provider (for example OpenAI web search). Author execute: providerTool({ … }); the compiler lifts the config onto the tool entry. The config must be an inline object literal of static, non-function properties:
web_search: {
execute: providerTool({
providerId: "openai.web_search_preview",
args: { searchContextSize: "low" },
}),
},Externally defined tools
Use externalTool() when a non-MCP tool is already defined and executed by another system (for example a separate backend route or LangGraph node) and you want assistant-ui to render its calls. The entry must declare render or renderText, and its key must match the tool name the other system publishes:
web_search: {
execute: externalTool(),
render: ({ args, result }) => (
<SearchResults query={args.query} results={result?.results ?? []} />
),
},The compiler omits this entry from the server build, so the model gets the tool definition from the external system. The client build keeps type: "backend", the renderer, and display, and drops description, parameters, and the other model-facing fields, so the entry registers no model-facing tool.
Without the compiler. If a file cannot go through the generative compiler, write a plain "use client" toolkit with an explicit type: "backend" and only a render. Register it like any other toolkit:
"use client";
import { defineToolkit } from "@assistant-ui/react";
export const toolkit = defineToolkit({
web_search: {
type: "backend",
render: ({ args, result }) => (
<SearchResults query={args.query} results={result?.results ?? []} />
),
},
});This { type: "backend", render } shape is for plain toolkits only. Inside a "use generative" file, use execute: externalTool(): generative tools must declare an execute, and the compiler overwrites any type you write.
Tool stubs (supply the executor elsewhere)
When a tool's executor has to close over React state (a useState setter, a ref), it cannot live in the build-split generative file. Declare the model-facing contract with execute: stubTool() and supply the real executor at runtime from the component that owns the state, with useAuiToolOverrides:
"use generative";
import { defineToolkit, stubTool } from "@assistant-ui/react";
import { manageTasksParameters } from "./state";
export default defineToolkit({
manage_tasks: {
description: "Add, toggle, or clear tasks on the board.",
parameters: manageTasksParameters,
execute: stubTool(),
renderText: { running: "Updating tasks…", complete: "Tasks updated" },
},
});import { useAuiToolOverrides } from "@assistant-ui/react";
function TaskBoardToolOverrides({ setTasks }) {
useAuiToolOverrides({
manage_tasks: {
execute: async ({ action, title }) => {
// close over setTasks here, then return a payload for the model
},
},
});
return null;
}stubTool() marks the executor as supplied later, while the compiler still ships the schema to the backend so the model can call the tool. Mount the override before the tool can be called: the server build your route imports advertises a compiled stub from its schema, but until an override supplies an execute, a call to it has no executor and stays without a result. See Dynamic tools for the full walkthrough.
Warning
useAuiToolOverrides is experimental and its API may change.
Rendering a tool call
render receives the live args, result, and status of the call and returns a React node. For a one-line status instead of a component, use renderText with a running and/or complete value, each a string or an ({ args, result }) => … function:
renderText: {
running: ({ args }) => `Searching for ${args.query}…`,
complete: "Search complete",
},Human tools render outside the collapsed tool group unless they set display: "inline"; set display: "standalone" on any other entry to render it there too. While a call runs, its arguments arrive as partial JSON: use useToolArgsStatus inside a renderer to react to each field as it streams in.
If you provide no renderer, add the ToolFallback component to render a default tool card. The full rendering API (status states, streaming arguments, deferred rendering, approvals) is covered in Tool UI.
Organizing toolkits
Keep schemas in a separate module
Importing your Zod schemas (and the z.infer argument types) from a plain .ts file keeps them out of the compiled boundary and lets your route handler and components share the same types:
import { z } from "zod";
export const getWeatherParameters = z.object({ location: z.string() });
export type GetWeatherArgs = z.infer<typeof getWeatherParameters>;Split tools across files and merge them
Each file you split into is its own "use generative" module that default-exports a defineToolkit(...):
"use generative";
import { defineToolkit } from "@assistant-ui/react";
export default defineToolkit({
get_weather: {
/* description, parameters, execute, render */
},
});Merge them by spreading their default imports into a parent toolkit:
"use generative";
import { defineToolkit } from "@assistant-ui/react";
import weatherTools from "./tools/weather";
import databaseTools from "./tools/database";
export default defineToolkit({
...weatherTools,
...databaseTools,
});The compiler splits each file across the client/server boundary on its own, then checks that the spread import resolves to a "use generative" module before allowing it, so a backend execute can't leak to the client. Two rules follow:
- Spread a default import (
import weatherTools from "./tools/weather"). Relative paths andtsconfigpath aliases like@/tools/weatherboth resolve. Only the default export crosses the generative-module boundary, so a named import, a namespace import, or any opaque non-generative import is rejected. - You can also spread a local
defineToolkit(...)ordefineMcpToolkit(...)binding declared in the same file.
The compiler checks static tool names across inline entries and compiler-visible spreads. If two fragments define the same tool name, the build warns that JavaScript object spread keeps the later definition.
Add MCP server tools
defineMcpToolkit exposes the tools of an MCP server. Each key names a server, not a tool. Spread it into a toolkit to expose MCP tools alongside your own, or export it directly for an MCP-only toolkit:
"use generative";
import { defineToolkit, defineMcpToolkit } from "@assistant-ui/react";
export default defineToolkit({
...defineMcpToolkit({
docs: { type: "http", url: "https://mcp.example.com/mcp" },
}),
// ...your own tools
});Tools skips these entries, and AISDKToolkit opens the connections on your server. The client build of a generative file keeps defineMcpToolkit(...) as written, so never put a token in headers or env there. MCP covers prefixes, hiding tools, credentials, approvals, and the connection lifecycle, and User-managed MCP covers servers your users add in the browser.
Tool options
Multi-modal tool results
By default a tool's execute result is sent to the model as a JSON blob. When the useful output is a file or image, add toModelOutput to project the result into the multi-modal content the model sees, while your render still receives the typed result:
read_pdf: {
description: "Fetch a PDF from a URL and return it.",
parameters: z.object({ url: z.string().url() }),
execute: async ({ url }) => {
const buf = new Uint8Array(await (await fetch(url)).arrayBuffer());
return { mediaType: "application/pdf", base64: toBase64(buf) };
},
toModelOutput: ({ output }) => [
{ type: "text", text: "PDF contents:" },
{ type: "file", data: output.base64, mediaType: output.mediaType },
],
},toModelOutput receives { toolCallId, input, output } and returns an array of ToolModelContentPart, a union of { type: "text"; text } and { type: "file"; data; mediaType; filename? }. With the AI SDK runtime, also pass the tool registry to convertToModelMessages so toModelOutput fires on round-tripped results; see Backend tools.
Per-tool provider options
Every tool accepts a providerOptions field, except external and MCP entries. assistant-ui serializes it verbatim under the tool entry, the AI SDK route forwards it, and the provider SDK reads the keys it cares about. This is how you opt into provider-specific behavior, such as Anthropic's progressive tool disclosure, without provider-aware code:
search_docs: {
description: "Search the documentation index.",
parameters: z.object({ query: z.string() }),
providerOptions: { anthropic: { deferLoading: true } },
execute: async ({ query }) => {
"use client";
return searchIndex(query);
},
renderText: { running: "Searching…", complete: "Done" },
},The outer key is the provider name; the inner object is whatever that provider's AI SDK package expects under tool.providerOptions[provider].
Cancellation and execution context
execute receives the tool arguments and a context object:
| Field | Meaning |
|---|---|
abortSignal | Aborts when the user stops the run. Pass it to any async I/O so the work stops immediately. |
toolCallId | Identifies the tool call being executed. |
human(payload) | Pauses a frontend tool and asks the UI for input. The call resolves with the value the UI passes to resume(). |
execute: async ({ query }, { abortSignal }) => {
"use client";
const res = await fetch(`/api/search?q=${query}`, { signal: abortSignal });
return res.json();
},human() only works in a frontend execute. A backend execute that calls it throws `human()` is not available during server-side tool execution.. See Pausing a frontend tool for the render side.
Disabling a tool
Set disabled: true on a tool entry to keep it known to the client but hidden from the model. A static disabled: true stays on both builds, so your server leaves the tool out of its tool set too.
To toggle a tool at runtime without editing the toolkit, register the same flag through useAuiToolOverrides:
import { useAuiToolOverrides } from "@assistant-ui/react";
function GuestModeTools() {
useAuiToolOverrides({
delete_account: { disabled: true },
});
return null;
}The override registers above the toolkit default. Mount it only while the tool should be hidden (for example for signed-out users); unmounting it restores the toolkit default.
A runtime override changes what the client uploads to the model. It cannot change what your server already advertises from a compiled toolkit, because the client never forwards disabled to the server. For such a tool the model can still name it, and a call to a disabled frontend tool gets the error result Tool "delete_account" is disabled. and execute does not run. To withhold a tool from the model entirely, leave it out of the toolkit your server builds for that request, or set disabled statically.
How toolkits compile and register
Two client scopes matter on this page. The modelContext scope collects everything the model is told about the next request (tools, system prompt, and call settings) from every registration in the tree. The tools scope holds the renderers for tool calls, keyed by tool name. The compiler decides what each build contains; Tools() then sends each toolkit entry to the right scope.
What each build keeps
You author one file; the plugin forks it per build target. The schema (description and parameters) is kept on both builds, so the model contract is identical and authoritative on the backend. The client marks its frontend and human schemas as backend-known and skips re-uploading them. The compiler infers each kind from execute (see Tool kinds) and writes it back as a type field.
| Kind | Server build keeps | Client build keeps |
|---|---|---|
| Backend | schema + execute | schema + render |
| Frontend | schema only | schema + execute + render/renderText |
| Human | schema only | schema + render |
| Stub (frontend, executor supplied at runtime) | schema only | schema + render/renderText |
| Provider | schema + provider config | schema + provider config |
| External (backend, defined elsewhere) | omitted | type: "backend" + render/renderText + display |
On Next.js, a server build that keeps a backend execute also imports server-only, so importing it from client code fails the build. Vite and Metro have no such layer and rely on their server and client environments to keep the two builds apart.
At build time the compiler also enforces that every tool declares an execute, that a frontend tool declares render or renderText, that a human tool declares render, and that an external tool declares render or renderText. See Troubleshooting for the exact messages.
Running without your own backend
The client build skips uploading frontend and human schemas because it assumes your backend imported the same file's server build and already knows them. When no server of yours does (for example, cloud-hosted runs), that assumption breaks and the model never learns about those tools. Compile with the backendless option so the client keeps every schema uploadable, including the present/prompt_user schema of a JSONGenerativeUI component library:
export default withAui({ ...yourConfig, aui: { backendless: true } });plugins: [aui({ backendless: true })];module.exports = withAui({
...getDefaultConfig(__dirname),
aui: { backendless: true },
});Registering a toolkit with Tools()
Tools({ toolkit }) is the resource that puts a toolkit to work. Pass it as the tools scope of an AuiConfig, and give the config to AssistantRuntimeProvider (or to an AuiProvider that extends a parent client). It takes two options: toolkit, and mcpApp for a generic MCP app renderer. The full signature is in the API reference.
Tools splits each toolkit entry in two:
| Part | Registered with | Notes |
|---|---|---|
render, or a component built from renderText | The tools scope, keyed by tool name | display: "standalone" entries, and human tools that do not set display, render outside the collapsed tool group. An entry with neither field, such as a tool you declare only for the model, registers no renderer; its calls render only if you provide a fallback such as ToolFallback. |
Everything else on the entry (type, description, parameters, execute, disabled, toModelOutput, providerOptions, ...) | modelContext | render, renderText, and display are removed first, so they never reach the model. |
Entries with type: "mcp" (from defineMcpToolkit) are skipped: your server opens those connections, so they are never registered with modelContext. If neither the config nor its parent client provides a modelContext scope, Tools adds one.
Where to mount it. Mount Tools once, next to the runtime, so every thread and message below it sees the renderers. To limit a toolkit to part of the tree, put it in an AuiProvider with extends and mount that around the subtree. A nested tools scope shadows the outer one: renderers registered by the outer Tools do not apply inside it, while the model-facing tools of both mounts still merge.
Identity. Tools registers when it mounts and registers again whenever toolkit changes identity. Import the toolkit from a module, or wrap one you build in useMemo. Building the AuiConfig and the Tools(...) element in the component body on every render is fine; the provider never relies on their identity. An object literal passed as toolkit is a new identity on every render and re-registers every tool each time.
Duplicate names. Tool names must be unique among the registrations of one modelContext that share a priority. The check runs when the model context is merged, which happens whenever the context is read (for example when modelContext.toolNames updates after a registration, and when the runtime builds a request), not when Tools mounts. A second registration that defines a name already registered at the same priority then throws You tried to define a tool with the name X, but it already exists. The merge skips the check when both registrations hold the identical tool object, or when the later tool sets overwrite: true, which the tool type documents as a discouraged escape hatch. Merge toolkits by spreading them (above) instead of mounting twice. If several registrations share a renderer name, the one registered first renders.
Overrides. useAuiToolOverrides registers at a higher priority and merges field by field over the entry with the same name, so an override can supply an execute or set disabled without redeclaring the schema. See Tool stubs and Disabling a tool.
Troubleshooting
Compiler errors
Each message starts with [assistant-ui/use-generative] and the file name.
| Message | Fix |
|---|---|
"use generative" must be the first statement of the file (only comments may precede it); otherwise the file is not compiled and its server code reaches the client | Move the directive above every import and above "use client". |
the default export must be defineToolkit({ ... }) or defineMcpToolkit({ ... }) (imported from "@assistant-ui/react")… | Wrap the default export. A bare object would ship a backend execute to the client. |
tool "x" must declare an `execute`; use `humanTool()` for a human-in-the-loop tool | Add an execute: a plain function, "use client", humanTool(), stubTool(), providerTool(...), or externalTool(). |
frontend tool "x" must declare a `render` or `renderText`… | Add a renderer, or remove "use client" to make it a backend tool. |
human tool "x" must declare a `render` so it can collect input | Add a render that calls addResult. |
external tool "x" must declare a `render` or `renderText`… | Add a renderer; externalTool() exists only to attach one. |
tool "x" cannot be `makeTool()`; use an inline object literal… | Rewrite the entry as an inline object, or spread a defineToolkit(...) or defineMcpToolkit(...) fragment. |
a namespace import (`import * as kit from "..."`) can't be spread into defineToolkit({ ... })… | Import the default export (import kit from "...") and spread ...kit. |
`providerTool(...)` must receive an inline object literal, `providerTool(...)` config cannot contain function-valued properties, or `providerTool(...)` config for "x" duplicates "name" | Pass a static object literal, and leave fields such as parameters out of the entry itself, since the config is lifted onto it. |
Duplicate tool name "x": … JavaScript object spread keeps the last definition. (a warning) | Rename one of the tools, or remove the one you do not want. |
@assistant-ui/core@… requires @assistant-ui/x-generative-compiler …, but the current compiler is … | Update @assistant-ui/next, @assistant-ui/vite, or @assistant-ui/metro to match your core version. |
Runtime problems
| Symptom | Cause | Fix |
|---|---|---|
humanTool() has no runtime implementation, or the same for externalTool(), stubTool(), providerTool() | The module was never compiled: the build plugin is missing, or the file has no (or a misplaced) "use generative" directive. | Add the plugin from Quick start and check the directive. |
`human()` is not available during server-side tool execution. | A backend execute called human(). | Make it a frontend tool, or a human tool. |
You tried to define a tool with the name X, but it already exists. | Two registrations define X at the same priority, for example two Tools mounts. | Mount Tools once and merge toolkits by spreading. |
| Every render re-registers the tools | toolkit is a new object on each render. | Import it from a module or wrap it in useMemo. |
| The tool call renders no custom UI | The toolkit key does not match the tool name, Tools is not mounted above the thread, or a nested tools scope shadows the outer renderers. | Match the key to the name the model calls, and check where Tools is mounted. |
The model never calls a frontend tool from a plain defineToolkit (no "use generative") | The entry has no execute, so the client does not upload it, or it sets disabled. | Add an execute, or remove disabled. |
| The model calls a stub tool and the call never gets a result | The server build your route imports advertises a compiled stub, but no useAuiToolOverrides with an execute is mounted. | Mount the override while the thread can call the tool. |
The model never calls a frontend or human tool from a "use generative" file | Your route does not know the tool: the client does not upload a compiled schema. | See Backend tools: troubleshooting. |
To see which tools are registered with the model, read useAuiState((s) => s.modelContext.toolNames).
Migrating from the component APIs
makeAssistantTool, useAssistantTool, makeAssistantToolUI, and useAssistantToolUI are deprecated. See Migrating Tools to Toolkits for the mechanical migration.