From 1ffc8be2b6917073902c002fc40bf74dd27cb8de Mon Sep 17 00:00:00 2001 From: Dax Raad Date: Thu, 18 Sep 2025 05:42:59 -0400 Subject: rework custom tools --- packages/plugin/src/tool.ts | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'packages/plugin/src/tool.ts') diff --git a/packages/plugin/src/tool.ts b/packages/plugin/src/tool.ts index 7c1d3d7c5..2998a1e72 100644 --- a/packages/plugin/src/tool.ts +++ b/packages/plugin/src/tool.ts @@ -7,14 +7,13 @@ export type ToolContext = { abort: AbortSignal } -export function tool( - input: (zod: typeof z) => { - description: string - args: Args - execute: (args: z.infer>, ctx: ToolContext) => Promise - }, -) { - return input(z) +export function tool(input: { + description: string + args: Args + execute(args: z.infer>, context: ToolContext): Promise +}) { + return input } +tool.schema = z export type ToolDefinition = ReturnType -- cgit v1.2.3