Tools

Give the model callable capabilities with assistant-ui toolkits — define frontend, backend, human, and provider tools, render tool calls as interactive UI, and connect MCP servers.

Tools are how the model takes action: fetch data, call an API, query a database, drive your UI, or run a workflow. 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.

Start here

Define tools with "use generative"

Use "use generative" + defineToolkit for toolkits. For tools that execute elsewhere, spread defineMcpToolkit({ ... }) for MCP servers or use execute: externalTool() to attach a renderer to a non-MCP external tool.

In a "use generative" file every tool declares an execute and the kind is inferred from it (you never write type). See Defining Tools.

Rendering AI output as UI

assistant-ui has a few ways to turn model output into React UI. Pick by who decides what renders:

You want…UseThe decider
A custom component for a known tool call (form, picker, chart, status)Tool UIrender on a toolkit entrythe model, by calling the tool
Persistent, out-of-thread state the AI can read and writeInteractablesthe model + the user, bidirectionally
UI composed from a component vocabulary you ship, described as a JSON specGenerative UI (JSON spec)MessagePrimitive.GenerativeUIthe model, composing a tree
UI pushed by a LangGraph node alongside messagesLangGraph Generative UImakeAssistantDataUIthe backend / orchestrator

Connect external tools

Reference & components