Tool
Type Parameters
Section titled “Type Parameters”| Type Parameter | Default type |
|---|---|
|
|
|
|
|
|
Properties
Section titled “Properties”description
Section titled “description”description: string;execute
Section titled “execute”execute: (args, ctx?) => Promise<TOutput> | AsyncIterable<TOutput, any, any>;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
|
|
|
|
|
Returns
Section titled “Returns”Promise<TOutput> | AsyncIterable<TOutput, any, any>
idempotencyKey?
Section titled “idempotencyKey?”optional idempotencyKey?: (args) => string;Override the auto-derived effect key (idempotencyKey(logicalRunId, callsite, {name,args})). Use when args are not a stable identity (e.g. a nonce).
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
|
|
|
Returns
Section titled “Returns”string
input?
Section titled “input?”optional input?: StandardSchemaV1<TInput, TInput>;interim?
Section titled “interim?”optional interim?: string;interimAfterMs?
Section titled “interimAfterMs?”optional interimAfterMs?: number;interruptible?
Section titled “interruptible?”optional interruptible?: boolean;name: string;needsApproval?
Section titled “needsApproval?”optional needsApproval?: boolean;onError?
Section titled “onError?”optional onError?: (error, args) => TOutput | Promise<TOutput>;Recover from a thrown error by returning a result the model can act on. Not called for timeouts, aborts, schema violations, or control-flow signals.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
|
|
|
|
|
|
Returns
Section titled “Returns”TOutput | Promise<TOutput>
output?
Section titled “output?”optional output?: StandardSchemaV1<TOutput, TOutput>;parallelSafe?
Section titled “parallelSafe?”optional parallelSafe?: boolean | ((args) => boolean);Safe to run concurrently with sibling calls in the same model-emitted batch. A function form receives the RAW (unvalidated) model args — classification happens before schema validation — and must not throw; a throw or a non-boolean return is treated as NOT parallel-safe. Never model-controlled: the model cannot assert this, only the tool author.
replay?
Section titled “replay?”optional replay?: boolean;When false, the durable journal always re-executes this tool instead of returning a cached step result — for observation/mutation tools (fs, shell) whose result must be fresh. Default true.
timeoutMs?
Section titled “timeoutMs?”optional timeoutMs?: number;