Skip to content
providerkit
GitHub

zodTool

function zodTool<I, O, R>(spec): Tool<I, O>;

Defined in: core/src/zod.ts:218

A zod tool that checks its results too. It returns what output makes of run’s result, so run can return unknown, or the string a transform turns into a Date.

Type Parameter
I
O
R
Parameter Type
spec ZodToolSpec<I, O, R> & object

Tool<I, O>

function zodTool<I, O>(spec): Tool<I, O>;

Defined in: core/src/zod.ts:226

A tool whose arguments are validated by zod, with the failure reported to the model in words it can act on. topic: expected string, received number beats a stack trace it cannot read.

Type Parameter
I
O
Parameter Type
spec ZodToolSpec<I, O>

Tool<I, O>