Tool
type Tool<TInput, TOutput> = { description?: string; id: string; input: TInput; name: string; output: TOutput; execute: Promise<output<TOutput>>;};Defined in: shared/src/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 Parameters
Section titled “Type Parameters”| Type Parameter | Default type |
|---|---|
TInput extends z.ZodType |
z.ZodType |
TOutput extends z.ZodType |
z.ZodType |
Properties
Section titled “Properties”description?
Section titled “description?”optional description?: string;Defined in: shared/src/tool/tool.ts:59
id: string;Defined in: shared/src/tool/tool.ts:57
input: TInput;Defined in: shared/src/tool/tool.ts:60
name: string;Defined in: shared/src/tool/tool.ts:58
output
Section titled “output”output: TOutput;Defined in: shared/src/tool/tool.ts:61
Methods
Section titled “Methods”execute()
Section titled “execute()”execute(input, context): Promise<output<TOutput>>;Defined in: shared/src/tool/tool.ts:64
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
input |
output<TInput> |
context |
ToolContext |
Returns
Section titled “Returns”Promise<output<TOutput>>