Skip to content

Tool

type Tool<TInput, TOutput> = {
description?: string;
id: string;
input: TInput;
name: string;
output: TOutput;
execute: Promise<output<TOutput>>;
};

Defined in: tool/tool.ts:56

A callable tool with a neutral, transport-agnostic interface: Zod-validated input/output and an execute that takes the input plus a slim ToolContext. This is the shared contract both the server (binding a Services container into an action) and the client (binding an HTTP call) produce, and that the sandbox and agent consume.

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

Defined in: tool/tool.ts:59


id: string;

Defined in: tool/tool.ts:57


input: TInput;

Defined in: tool/tool.ts:60


name: string;

Defined in: tool/tool.ts:58


output: TOutput;

Defined in: tool/tool.ts:61

execute(input, context): Promise<output<TOutput>>;

Defined in: tool/tool.ts:64

Parameter Type
input output<TInput>
context ToolContext

Promise<output<TOutput>>