I have been having this strange issue with my agents recently where my agent tries to call a tool in the agent with the wrong id. for example I have a tool whose id is defined as "create-scenario" but the AI is trying to call a tool with the name "createscenario" or "CreatescenarioScenarios" instead and this obviously leads to failuere:
export const createScenario = createTool({
id: 'create-scenario',
description: 'Create a new scenario',
inputSchema: z.object({
scenarios: z.array(z.object({
title: z.string().describe('Title of the scenario'),
description: z.string().describe('A detailed description of the scenario mentioning the end goal')
})),
url: z.string().describe('Base URL of the platform to explore'),
}),
outputSchema: z.object({
success: z.boolean(),
}),
execute: async ({ context, runtimeContext }) => {
/// execute method
} catch (error) {
console.log(error)
return { success: false, message: "Failed to add scenarios: " + error }
}
}
});