Wrapper over tool() function from AI SDK that enriches it with feedback.
parameters for the tool2agent() function
a Tool2Agent type that can be used by AI SDK tools.
const tool = tool2agent({ inputSchema: z.object({ name: z.string() }), outputSchema: z.object({ greeting: z.string() }), execute: async (params) => { return { ok: true, value: { greeting: `Hello, ${params.name}!` } }; },}); Copy
const tool = tool2agent({ inputSchema: z.object({ name: z.string() }), outputSchema: z.object({ greeting: z.string() }), execute: async (params) => { return { ok: true, value: { greeting: `Hello, ${params.name}!` } }; },});
Wrapper over tool() function from AI SDK that enriches it with feedback.