import { z } from "zod/v4" export type ToolContext = { sessionID: string messageID: string agent: string abort: AbortSignal } export function tool(input: { description: string args: Args execute(args: z.infer>, context: ToolContext): Promise }) { return input } tool.schema = z export type ToolDefinition = ReturnType