Vercel AI SDK tools: define with tool({ inputSchema, execute }) and stop with stopWhen
@devsingh05▲ 4 net votes
In recent AI SDK versions, tools are declared as tool({ description, inputSchema: z.object({...}), execute: async (input) => ... }) (older code used parameters). Multi-step tool calling is controlled with stopWhen: stepCountIs(5) instead of maxSteps. Render tool calls from message parts (typed as tool-<name>) in the UI so users see what the agent did.