list_voices
Discover and retrieve all available text-to-speech voice options provided by the Speech MCP Server for use in TTS applications.
Instructions
List all available voices for text-to-speech
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:309-317 (handler)Handler for the 'list_voices' tool: calls ttsClient.listVoices() and returns formatted list of voices.case "list_voices": { const voices = await ttsClient.listVoices(); return { content: [{ type: "text", text: `Available voices:\n${voices.join('\n')}` }], }; }
- src/index.ts:218-228 (helper)Core implementation of listing voices: waits for TTS init, filters high-quality voices from ttsInstance.voices, returns KokoroVoice[]async listVoices(): Promise<KokoroVoice[]> { await this.waitForInit(); if (!this.ttsInstance) { throw new Error("TTS model not initialized"); } // @ts-ignore-line const allVoices = this.ttsInstance.voices as unknown as {[voice: string]: {overallGrade: string; gender: string}}; const goodVoices = Object.keys(allVoices) .filter((voiceName) => ['A+', 'A', 'A-', 'B+', 'B', 'B-', 'C+'].includes(allVoices[voiceName].overallGrade)) return goodVoices as unknown as KokoroVoice[]; }
- src/index.ts:88-96 (registration)Defines and registers the 'list_voices' tool object, including its schema (no input params).const listVoicesTool: Tool = { name: "list_voices", description: "List all available voices for text-to-speech", inputSchema: { type: "object", properties: {}, required: [], }, };
- src/index.ts:355-361 (registration)Registers 'list_voices' tool (via listVoicesTool) in the ListTools response.tools: [ textToSpeechTool, textToSpeechWithOptionsTool, listVoicesTool, getModelStatusTool, ], };
- src/index.ts:91-95 (schema)Input schema for 'list_voices' tool: empty object (no parameters required).inputSchema: { type: "object", properties: {}, required: [], },