retell_list_voices
Retrieve available voice options for configuring AI agents in the Retell AI platform.
Instructions
List all available voices for use with agents.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:1249-1250 (handler)The handler logic in the executeTool function's switch statement. It calls the generic retellRequest helper with a GET request to the Retell API's /list-voices endpoint to retrieve the list of available voices.case "retell_list_voices": return retellRequest("/list-voices", "GET");
- src/index.ts:1018-1025 (registration)The tool registration definition in the tools array, including name, description, and input schema. This is returned by the listTools MCP handler.{ name: "retell_list_voices", description: "List all available voices for use with agents.", inputSchema: { type: "object", properties: {} } },
- src/index.ts:1021-1024 (schema)Input schema definition for the tool, specifying an empty object (no input parameters required).inputSchema: { type: "object", properties: {} }
- src/index.ts:23-57 (helper)Generic helper function used by all Retell tools, including retell_list_voices, to make authenticated API requests to the Retell service.async function retellRequest( endpoint: string, method: string = "GET", body?: Record<string, unknown> ): Promise<unknown> { const apiKey = getApiKey(); const headers: Record<string, string> = { "Authorization": `Bearer ${apiKey}`, "Content-Type": "application/json", }; const options: RequestInit = { method, headers, }; if (body && method !== "GET") { options.body = JSON.stringify(body); } const response = await fetch(`${RETELL_API_BASE}${endpoint}`, options); if (!response.ok) { const errorText = await response.text(); throw new Error(`Retell API error (${response.status}): ${errorText}`); } // Handle 204 No Content if (response.status === 204) { return { success: true }; } return response.json(); }
- src/index.ts:1283-1285 (registration)MCP server registration for the ListToolsRequestSchema handler, which returns the full tools array including retell_list_voices.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools }; });