Interface CreateToolConfigWithSchema<T>

Configuration for creating a tool with schema

interface CreateToolConfigWithSchema<T> {
    name: string;
    description: string;
    schema: ZodType<T, unknown, $ZodTypeInternals<T, unknown>>;
    fn: ((args: T, context: ToolContext) => any);
    isLongRunning?: boolean;
    shouldRetryOnFailure?: boolean;
    maxRetryAttempts?: number;
}

Type Parameters

  • T extends Record<string, any>

Properties

name: string

The name of the tool

description: string

A description of what the tool does

schema: ZodType<T, unknown, $ZodTypeInternals<T, unknown>>

Zod schema for validating tool arguments

fn: ((args: T, context: ToolContext) => any)

The function to execute (can be sync or async)

isLongRunning?: boolean

Whether the tool is a long running operation

shouldRetryOnFailure?: boolean

Whether the tool execution should be retried on failure

maxRetryAttempts?: number

Maximum retry attempts