Skip to content

ZodToolConfig

Defined in: src/tools/zod-tool.ts:20

Configuration for creating a Zod-based tool.

Type ParameterDefault typeDescription
TInput extends z.ZodType | undefined-Zod schema type for input validation
TReturn extends JSONValueJSONValueReturn type of the callback function
name: string;

Defined in: src/tools/zod-tool.ts:22

The name of the tool


optional description: string;

Defined in: src/tools/zod-tool.ts:25

A description of what the tool does (optional)


optional inputSchema: TInput;

Defined in: src/tools/zod-tool.ts:31

Zod schema for input validation and JSON schema generation. If omitted or z.void(), the tool takes no input parameters.


callback: (input, context?) =>
| TReturn
| AsyncGenerator<unknown, TReturn, never>
| Promise<TReturn>;

Defined in: src/tools/zod-tool.ts:40

Callback function that implements the tool’s functionality.

ParameterTypeDescription
inputZodInferred<TInput>Validated input matching the Zod schema
context?ToolContextOptional execution context

| TReturn | AsyncGenerator<unknown, TReturn, never> | Promise<TReturn>

The result (can be a value, Promise, or AsyncGenerator)