ZodToolConfig
Defined in: src/tools/zod-tool.ts:20
Configuration for creating a Zod-based tool.
Type Parameters
Section titled “Type Parameters”| Type Parameter | Default type | Description |
|---|---|---|
TInput extends z.ZodType | undefined | - | Zod schema type for input validation |
TReturn extends JSONValue | JSONValue | Return type of the callback function |
Properties
Section titled “Properties”name: string;Defined in: src/tools/zod-tool.ts:22
The name of the tool
description?
Section titled “description?”optional description: string;Defined in: src/tools/zod-tool.ts:25
A description of what the tool does (optional)
inputSchema?
Section titled “inputSchema?”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()
Section titled “callback()”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.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
input | ZodInferred<TInput> | Validated input matching the Zod schema |
context? | ToolContext | Optional execution context |
Returns
Section titled “Returns”| TReturn
| AsyncGenerator<unknown, TReturn, never>
| Promise<TReturn>
The result (can be a value, Promise, or AsyncGenerator)