list_voices
Retrieve available VOICEVOX voice characters to select speakers for text-to-speech synthesis and audio playback.
Instructions
利用可能な音声の一覧を取得
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/voicevox.ts:15-31 (handler)The getVoices() method that implements the core logic for list_voices. It fetches speakers from the VOICEVOX API, iterates through them and their styles, and returns an array of Voice objects with character, name, and id.
async getVoices(): Promise<Voice[]> { const response = await fetch(`${this.baseUrl}/speakers`); const speakers = await response.json() as any[]; const voices: Voice[] = []; for (const speaker of speakers) { for (const style of speaker.styles) { voices.push({ character: speaker.name, name: style.name, id: style.id, }); } } return voices; } - src/index.ts:191-201 (handler)The case handler for list_voices tool in the main switch statement. It calls voicevox.getVoices() and returns the result as JSON-formatted text content.
case "list_voices": { const voices = await voicevox.getVoices(); return { content: [ { type: "text", text: JSON.stringify(voices, null, 2), }, ], }; } - src/index.ts:90-97 (registration)Tool registration for list_voices in the ListToolsRequestSchema handler. Defines the tool name, description, and empty input schema.
{ name: "list_voices", description: "利用可能な音声の一覧を取得", inputSchema: { type: "object", properties: {}, }, }, - src/voicevox.ts:1-5 (schema)Voice interface/type definition that defines the structure of voice objects returned by list_voices.
export interface Voice { character: string; name: string; id: number; }