Skip to content

defineTool

function defineTool<S, R>(config): EffectTool<InferToolInput<S>, R>;
Type Parameter Default type

S extends ZodTypeAny | StandardSchemaV1<unknown, unknown> | undefined

undefined

R

unknown

Parameter Type

config

{ description: string; execute: (args, ctx?) => Promise<R> | AsyncIterable<R, any, any>; input?: S; interim?: string; interimAfterMs?: number; interruptible?: boolean; name?: string; needsApproval?: boolean; output?: StandardSchemaV1<R, R>; }

config.description

string

config.execute

(args, ctx?) => Promise<R> | AsyncIterable<R, any, any>

config.input?

S

config.interim?

string

config.interimAfterMs?

number

config.interruptible?

boolean

config.name?

string

config.needsApproval?

boolean

config.output?

StandardSchemaV1<R, R>

EffectTool<InferToolInput<S>, R>