Appearance
Interface: ToolConfig<S>
Defined in: packages/sdk/src/renderer/templates/chat-tools.ts:269
A tool the model can call. Matches the Vercel AI SDK's tool() — inputSchema + execute(input, options) — with confirm and the reply / ui / plan() returns added on top. A vanilla AI-SDK tool's bare-value return is treated as something for the AI to phrase.
Type Parameters
| Type Parameter | Description |
|---|---|
S extends z.ZodType | The Zod schema for the tool's input. |
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
description | string | What the model reads to decide when to call this tool. | packages/sdk/src/renderer/templates/chat-tools.ts:271 |
execute | (input: output<S>, options: ToolRunOptions) => | ChatToolReturn | Promise<ChatToolReturn> | The tool's action — runs skill-side (Node), so fetch, secrets, and (via closure) ctx are available; the second argument carries the runtime agent and the raw text. Return reply for verbatim text, a bare value to let the AI phrase it, ui for rendered blocks, or plan(). Throwing is safe: it is caught and shown as a graceful error. | packages/sdk/src/renderer/templates/chat-tools.ts:279 |
inputSchema? | S | Zod schema for the model-supplied input. | packages/sdk/src/renderer/templates/chat-tools.ts:284 |
confirm? | (input: output<S>, options: ToolRunOptions) => ChatConfirmResult | Promise<ChatConfirmResult> | Require human approval before execute runs. Return a prompt (string or full spec) to gate the call — execute fires only after the user approves, on every model path. Return a falsy value to skip the gate for this call (conditional confirmation). | packages/sdk/src/renderer/templates/chat-tools.ts:291 |