Skip to content

Action

type Action<TInput, TOutput> = {
description?: string;
execute: (context) => Promise<z.infer<TOutput>>;
id: string;
input: TInput;
name: string;
output: TOutput;
};

Defined in: core/src/action/action.types.ts:31

A callable tool: identified by id, with Zod-validated input and output schemas and an execute that runs the tool given an ActionContext.

Type Parameter Default type
TInput extends z.ZodType z.ZodType
TOutput extends z.ZodType z.ZodType
optional description?: string;

Defined in: core/src/action/action.types.ts:34


execute: (context) => Promise<z.infer<TOutput>>;

Defined in: core/src/action/action.types.ts:37

Parameter Type
context ActionContext<TInput>

Promise<z.infer<TOutput>>


id: string;

Defined in: core/src/action/action.types.ts:32


input: TInput;

Defined in: core/src/action/action.types.ts:35


name: string;

Defined in: core/src/action/action.types.ts:33


output: TOutput;

Defined in: core/src/action/action.types.ts:36