M
Mastraโ€ข4w ago
ttsubasa

GeminiLiveVoice: Tool calls work but args always empty - Expected behavior?

Hi Mastra team! ๐Ÿ‘‹ I'm having trouble getting tool arguments to populate in GeminiLiveVoice. Tools are called but args are always empty. Am I missing some configuration? Current Setup:
// Agent setup
const agent = new Agent({
tools: { getWeather },
voice: new GeminiLiveVoice({
vertexAI: true,
model: 'gemini-2.0-flash-live-preview-04-09',
// ... other config
})
});

// Tool registration
voice.addTools(agent.tools); // Is this the correct way?
// Agent setup
const agent = new Agent({
tools: { getWeather },
voice: new GeminiLiveVoice({
vertexAI: true,
model: 'gemini-2.0-flash-live-preview-04-09',
// ... other config
})
});

// Tool registration
voice.addTools(agent.tools); // Is this the correct way?
Tool definition:
getWeather: {
description: "Get weather information for a specific location",
parameters: z.object({
location: z.string().describe("Location to get weather for")
}),
execute: async ({ location }) => {
return await fetchWeather(location);
}
}
getWeather: {
description: "Get weather information for a specific location",
parameters: z.object({
location: z.string().describe("Location to get weather for")
}),
execute: async ({ location }) => {
return await fetchWeather(location);
}
}
What happens: โœ… Tools register successfully:
[GeminiLiveVoice] Tools added { toolCount: 3 }
[GeminiLiveVoice] Tools added { toolCount: 3 }
โœ… Tools get called when user says "ๆฑไบฌใฎๅคฉๆฐ—ใ‚’ๆ•™ใˆใฆ":
[GeminiLiveVoice] Processing tool call {
toolName: 'getWeather',
toolArgs: {},
toolId: '6e580cf7-6c24-46b1-9beb-hogehoge'
}
[GeminiLiveVoice] Processing tool call {
toolName: 'getWeather',
toolArgs: {},
toolId: '6e580cf7-6c24-46b1-9beb-hogehoge'
}
โŒ But args are always empty:
Tool validation failed:
- location: Invalid input: expected string, received undefined
Provided arguments: {}
Tool validation failed:
- location: Invalid input: expected string, received undefined
Provided arguments: {}
Questions: 1. Is voice.addTools(agent.tools) the correct setup? 2. Do I need additional configuration for argument extraction from speech? 3. Are there specific sessionConfig settings required for tool arguments? 4. Should I handle speech โ†’ arguments mapping manually? Using gemini-2.0-flash-live-preview-04-09 with latest Mastra. Any insights would be super helpful! ๐Ÿ™
1 Reply
Mastra Triager
Mastra Triagerโ€ข4w ago
๐Ÿ“ Created GitHub issue: https://github.com/mastra-ai/mastra/issues/10161 ๐Ÿ” If you're experiencing an error, please provide a minimal reproducible example to help us resolve it quickly. ๐Ÿ™ Thank you @ttsubasa for helping us improve Mastra!
GitHub
GeminiLiveVoice: Tool calls work but args always empty - Expected b...
This issue was created from Discord post 1439931524081385492: Hi Mastra team! ๐Ÿ‘‹ I'm having trouble getting tool arguments to populate in GeminiLiveVoice. Tools are called but args are always em...
Stack Overflow
How to create a Minimal, Reproducible Example - Help Center
Stack Overflow | The Worldโ€™s Largest Online Community for Developers

Did you find this page helpful?