listAudioVoices
Access a comprehensive list of available audio voices for text-to-speech generation on the Pollinations Multimodal MCP Server, enabling precise voice selection for audio content creation.
Instructions
List available audio voices
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/services/audioService.js:216-257 (handler)The main handler function for the 'listAudioVoices' tool. It fetches the list of available audio voices from the Pollinations API (models endpoint), extracts voices from the 'openai-audio' model, or falls back to a default list on error.async function listAudioVoices(params) { try { const url = buildUrl(AUDIO_API_BASE_URL, "models"); const response = await fetch(url); if (!response.ok) { throw new Error(`Failed to list models: ${response.statusText}`); } const models = await response.json(); // Find the openai-audio model and extract its voices const audioModel = models.find( (model) => model.name === "openai-audio", ); let voices; if (audioModel && Array.isArray(audioModel.voices)) { voices = audioModel.voices; } else { // Default voices if we can't find the list voices = ["alloy", "echo", "fable", "onyx", "nova", "shimmer"]; } // Return the response in MCP format using utility functions return createMCPResponse([createTextContent(voices, true)]); } catch (error) { console.error("Error listing audio voices:", error); // Return default voices if there's an error const defaultVoices = [ "alloy", "echo", "fable", "onyx", "nova", "shimmer", ]; // Return the response in MCP format using utility functions return createMCPResponse([createTextContent(defaultVoices, true)]); } }
- src/services/audioService.js:381-381 (registration)The tool registration array entry within the exported 'audioTools' array, which is later imported and registered in src/index.js via server.tool().["listAudioVoices", "List available audio voices", {}, listAudioVoices],