Skip to main content
Glama

search_voice_library

Search and filter voices from the ElevenLabs voice library by name or characteristics to find the perfect voice for your text-to-speech projects.

Instructions

Search for a voice across the entire ElevenLabs voice library.

Args:
    page: Page number to return (0-indexed)
    page_size: Number of voices to return per page (1-100)
    search: Search term to filter voices by

Returns:
    TextContent containing information about the shared voices

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pageNo
page_sizeNo
searchNo

Implementation Reference

  • The handler function implementing the 'search_voice_library' tool. It fetches shared voices from ElevenLabs using client.voices.get_shared(), processes voice details including languages, gender, age, etc., and returns formatted TextContent.
    def search_voice_library(
        page: int = 0,
        page_size: int = 10,
        search: str | None = None,
    ) -> TextContent:
        response = client.voices.get_shared(
            page=page,
            page_size=page_size,
            search=search,
        )
    
        if not response.voices:
            return TextContent(
                type="text", text="No shared voices found with the specified criteria."
            )
    
        voice_list = []
        for voice in response.voices:
            language_info = "N/A"
            if hasattr(voice, "verified_languages") and voice.verified_languages:
                languages = []
                for lang in voice.verified_languages:
                    accent_info = (
                        f" ({lang.accent})"
                        if hasattr(lang, "accent") and lang.accent
                        else ""
                    )
                    languages.append(f"{lang.language}{accent_info}")
                language_info = ", ".join(languages)
    
            details = [
                f"Name: {voice.name}",
                f"ID: {voice.voice_id}",
                f"Category: {getattr(voice, 'category', 'N/A')}",
            ]
            # TODO: Make cleaner
            if hasattr(voice, "gender") and voice.gender:
                details.append(f"Gender: {voice.gender}")
            if hasattr(voice, "age") and voice.age:
                details.append(f"Age: {voice.age}")
            if hasattr(voice, "accent") and voice.accent:
                details.append(f"Accent: {voice.accent}")
            if hasattr(voice, "description") and voice.description:
                details.append(f"Description: {voice.description}")
            if hasattr(voice, "use_case") and voice.use_case:
                details.append(f"Use Case: {voice.use_case}")
    
            details.append(f"Languages: {language_info}")
    
            if hasattr(voice, "preview_url") and voice.preview_url:
                details.append(f"Preview URL: {voice.preview_url}")
    
            voice_info = "\n".join(details)
            voice_list.append(voice_info)
    
        formatted_info = "\n\n".join(voice_list)
        return TextContent(type="text", text=f"Shared Voices:\n\n{formatted_info}")
  • The @mcp.tool decorator registers the 'search_voice_library' tool with MCP, including the description that serves as input/output schema.
    @mcp.tool(
        description="""Search for a voice across the entire ElevenLabs voice library.
    
        Args:
            page: Page number to return (0-indexed)
            page_size: Number of voices to return per page (1-100)
            search: Search term to filter voices by
    
        Returns:
            TextContent containing information about the shared voices
        """
    )
  • The tool description defines the input parameters (page, page_size, search) and return type (TextContent), serving as the schema.
        description="""Search for a voice across the entire ElevenLabs voice library.
    
        Args:
            page: Page number to return (0-indexed)
            page_size: Number of voices to return per page (1-100)
            search: Search term to filter voices by
    
        Returns:
            TextContent containing information about the shared voices
        """
    )
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It mentions pagination behavior and search filtering, which is helpful, but doesn't cover important aspects like rate limits, authentication requirements, error conditions, or what specific information is returned in the 'TextContent'. For a search tool with 3 parameters, this leaves significant behavioral gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is perfectly structured and concise. It begins with a clear purpose statement, then provides organized parameter documentation with helpful constraints, and concludes with return value information. Every sentence adds value with zero wasted words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations and no output schema, the description does reasonably well covering the basics: purpose, parameters, and return type. However, for a search tool with pagination and filtering capabilities, it should ideally mention more about the search behavior (e.g., case sensitivity, partial matching), result format details, or error handling to be fully complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage, the description must fully compensate, and it does so effectively. It clearly explains all three parameters: 'page' (0-indexed page number), 'page_size' (range 1-100 voices per page), and 'search' (search term for filtering). This provides meaningful context beyond the basic schema types and defaults.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Search for a voice') and resource ('across the entire ElevenLabs voice library'), making the purpose immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'search_voices' or 'get_voice', which appears to be a similar voice-related tool, leaving some ambiguity about when to use each.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. With sibling tools like 'search_voices' and 'get_voice' present, there's no indication of how this tool differs in scope, functionality, or appropriate use cases, leaving the agent to guess about tool selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/projectservan8n/elevenlabs-mcp'

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