Skip to main content
Glama
mamertofabian

ElevenLabs MCP Server

list_voices

Retrieve available voice options with metadata from ElevenLabs text-to-speech service to select appropriate voices for audio generation.

Instructions

Get a list of all available ElevenLabs voices with metadata

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler for the 'list_voices' tool within the call_tool dispatcher. Retrieves voices from database cache, refreshes via ElevenLabs API if needed, marks default voice, and returns JSON list.
    elif name == "list_voices":
        try:
            # Get voices from cache
            voices, needs_refresh = await self.db.get_voices()
            
            # Refresh cache if needed
            if needs_refresh:
                try:
                    fresh_voices = await asyncio.to_thread(self.api.get_voices)
                    await self.db.upsert_voices(fresh_voices)
                    voices = fresh_voices
                except Exception as e:
                    logging.error(f"Error refreshing voices: {e}")
                    # Continue with cached data if refresh fails
                    if not voices:
                        raise  # Re-raise if we have no data at all
            
            # Ensure default voice is marked
            for voice in voices:
                voice["is_default"] = voice["voice_id"] == self.api.voice_id
            
            return [types.TextContent(
                type="text",
                text=json.dumps(voices, indent=2)
            )]
        except Exception as e:
            return [types.TextContent(
                type="text",
                text=json.dumps({"error": str(e)}, indent=2)
            )]
  • Registration of the 'list_voices' tool in the list_tools() response, including description and empty input schema.
    types.Tool(
        name="list_voices",
        description="Get a list of all available ElevenLabs voices with metadata",
        inputSchema={
            "type": "object",
            "properties": {},  # No parameters needed
            "required": []
        }
    ),
  • Input schema for 'list_voices' tool: empty object with no required properties.
    inputSchema={
        "type": "object",
        "properties": {},  # No parameters needed
        "required": []
    }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mamertofabian/elevenlabs-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server