Declares a tool while preserving TypeScript inference for its argument shape.
const weather = defineTool({ name: 'lookup_weather', description: 'Look up weather by city', parameters: { type: 'object', properties: { city: { type: 'string' }, }, required: ['city'], }, async execute(args) { return { city: args.city, forecast: 'Sunny' }; },}); Copy
const weather = defineTool({ name: 'lookup_weather', description: 'Look up weather by city', parameters: { type: 'object', properties: { city: { type: 'string' }, }, required: ['city'], }, async execute(args) { return { city: args.city, forecast: 'Sunny' }; },});
Declares a tool while preserving TypeScript inference for its argument shape.