tools
БесплатноБез исполняемых скриптовНе проверенDefines model-callable tools and renders their calls in assistant-ui. The authoring model: a "use generative" file whose default export is…
от assistant-ui★ 30 звёзд на GitHubОб этом скилле
assistant-ui Tools
Always consult assistant-ui.com/llms.txt for the latest API.
A tool is a named capability the model can call. In assistant-ui you declare tools in a toolkit, a map whose keys are the tool names the model sees and whose values carry the schema, the executor, and the renderer. The supported authoring path is a "use generative" file compiled by a build plugin, which splits one file into a server build (schema plus backend executors) and a client build (schema plus renderers plus browser executors).
References
- ./references/toolkits.md -- authoring a toolkit end to end: kinds, renderers,
toModelOutput,providerOptions, stubs, splitting and merging files,backendless - ./references/tool-ui.md -- rendering states,
useToolArgsStatus, deferred rendering, streaming args,ToolFallbackandToolGroup - ./references/human-in-loop.md -- human tools,
human()interrupts, and the full approval gate surface - ./references/mcp-server.md -- server-side MCP servers and
defineMcpToolkit - ./references/mcp-apps.md -- rendering MCP App
ui://widgets withMcpAppRenderer - ./references/webmcp.md -- publishing frontend tools to the browser agent with
unstable_useWebMcpProvider - ./references/multi-agent.md -- sub-agent conversations inside a tool call
- ./references/legacy-component-apis.md -- the deprecated
makeAssistantToolfamily and how to migrate off it
The authoring model
1. Add the build plugin
The directive does nothing without a compiler.
import { withAui } from "@assistant-ui/next";
export default withAui({
/* your Next config */
});
Vite and TanStack Start add aui() from @assistant-ui/vite to plugins instead; Expo and bare React Native wrap the Metro config with withAui from @assistant-ui/metro. All three take an aui options object, documented in toolkits.md.
2. Write the toolkit
"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 }) =>
result ? (
<div>
{result.temperature} {args.unit}
</div>
) : (
<div>Fetching weather for {args.location}</div>
),
},
});
3. Mount it on the client
"use client";
import { AssistantRuntimeProvider, AuiConfig, Tools } from "@assistant-ui/react";
import { useChatRuntime } from "@assistant-ui/ai-sdk";
import toolkit from "./toolkit";
export function MyRuntimeProvider({ children }: { children: React.ReactNode }) {
const runtime = useChatRuntime();
const config = AuiConfig({ tools: Tools({ toolkit }) });
return (
<AssistantRuntimeProvider runtime={runtime} config={config}>
{children}
</AssistantRuntimeProvider>
);
}
To scope a toolkit to part of the tree instead, wrap that subtree in <AuiProvider extends={aui} config={config}> with const aui = useAui(). useChatRuntime() targets /api/chat by default.
4. Expose it to the model
The same import resolves to the server build inside a route handler.
import { AISDKToolkit } from "@assistant-ui/ai-sdk";
import { streamText, convertToModelMessages } 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, system, tools } = await req.json();
const result = streamText({
model: openai("gpt-5.6-luna"),
system,
messages: await convertToModelMessages(messages),
tools: await aiToolkit.tools({ frontend: tools }),
});
return result.toUIMessageStreamResponse();
}
AISDKToolkit.tools() registers every toolkit tool with the model, wires the backend execute where the server build carries one, merges the frontend tools the client uploaded in the request body, and opens any MCP servers the toolkit spreads in. A server execute wins over an uploaded entry of the same name.
Tool kinds
The kind is inferred from execute and written back as type. You never author type in a "use generative" file.
| execute you write | Inferred kind | Server build keeps | Client build keeps |
| --- | --- | --- |
Установить tools в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл tools?
Defines model-callable tools and renders their calls in assistant-ui. The authoring model: a "use generative" file whose default export is defineToolkit({...}), compiled by withAui from @assistant-ui/next, aui() from @assistant-ui/vite, or withAui from @assistant-ui/metro, mounted with AuiConfig({ tools: Tools({ toolkit }) }), and exposed to the model with new AISDKToolkit({ toolkit }).tools({ frontend }). Covers the tool kinds (backend, "use client" frontend, humanTool(), providerTool(), externalTool(), stubTool(), defineMcpToolkit()), render and display, ToolCallMessagePartProps, approval gates, MCP servers, MCP Apps, WebMCP, and sub-agent messages. Reach for it when a tool is never called, a tool UI does not render, a frontend result never reaches the model, humanTool() throws at runtime, or an approval gate cannot be answered. For model-composed UI use generative-ui, for MCP servers users add in the browser use react-mcp, and for the styled ToolFallback and ToolGroup use elements.
Как установить скилл tools?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл tools запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic