get_all_voices
Retrieve a paginated list of available voices for text-to-speech and voice conversion tasks. Use limit and page parameters to navigate results efficiently.
Instructions
Get a paginated list of all available voices for voice conversion and TTS
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum number of voices per page (default: 20) | |
| page | No | Page number for pagination (default: 0) |
Implementation Reference
- src/index.ts:788-804 (handler)The core handler function that implements the get_all_voices tool logic. It constructs pagination parameters from input args, performs a GET request to the MusicGPT API endpoint '/getAllVoices', and returns the response data as formatted JSON text content.private async handleGetAllVoices(args: any) { const params = { limit: args.limit || 20, page: args.page || 0, }; const response = await this.axiosInstance.get("/getAllVoices", { params }); return { content: [ { type: "text", text: JSON.stringify(response.data, null, 2), }, ], }; }
- src/index.ts:86-104 (registration)Tool registration definition in the TOOLS array. Defines the tool name, description, and input schema for pagination parameters. This is used by the MCP server's ListToolsRequestHandler to advertise the tool.{ name: "get_all_voices", description: "Get a paginated list of all available voices for voice conversion and TTS", inputSchema: { type: "object" as const, properties: { limit: { type: "number", description: "Maximum number of voices per page (default: 20)", default: 20, }, page: { type: "number", description: "Page number for pagination (default: 0)", default: 0, }, }, }, },
- src/index.ts:663-664 (registration)Dispatch registration in the CallToolRequestHandler switch statement. Routes incoming calls to the 'get_all_voices' tool to the appropriate handler method.case "get_all_voices": return await this.handleGetAllVoices(args);