Skip to main content
Glama

speech_to_speech

Convert audio files from one voice to another using ElevenLabs voice transformation technology. Provide an input audio file and specify the target voice to generate new audio output.

Instructions

Transform audio from one voice to another using provided audio files.

⚠️ COST WARNING: This tool makes an API call to ElevenLabs which may incur costs. Only use when explicitly requested by the user.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
input_file_pathYes
output_directoryNo
voice_nameNoAdam

Implementation Reference

  • The speech_to_speech tool handler: transforms input audio file to speech in the specified voice using ElevenLabs client.speech_to_speech.convert, saves output MP3 file.
    @mcp.tool(
        description="""Transform audio from one voice to another using provided audio files.
    
        ⚠️ COST WARNING: This tool makes an API call to ElevenLabs which may incur costs. Only use when explicitly requested by the user.
        """
    )
    def speech_to_speech(
        input_file_path: str,
        voice_name: str = "Adam",
        output_directory: str | None = None,
    ) -> TextContent:
        voices = client.voices.search(search=voice_name)
    
        if len(voices.voices) == 0:
            make_error("No voice found with that name.")
    
        voice = next((v for v in voices.voices if v.name == voice_name), None)
    
        if voice is None:
            make_error(f"Voice with name: {voice_name} does not exist.")
    
        assert voice is not None  # Type assertion for type checker
        file_path = handle_input_file(input_file_path)
        output_path = make_output_path(output_directory, base_path)
        output_file_name = make_output_file("sts", file_path.name, output_path, "mp3")
    
        with file_path.open("rb") as f:
            audio_bytes = f.read()
    
        audio_data = client.speech_to_speech.convert(
            model_id="eleven_multilingual_sts_v2",
            voice_id=voice.voice_id,
            audio=audio_bytes,
        )
    
        audio_bytes = b"".join(audio_data)
    
        with open(output_path / output_file_name, "wb") as f:
            f.write(audio_bytes)
    
        return TextContent(
            type="text", text=f"Success. File saved as: {output_path / output_file_name}"
        )
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively warns about API costs and external dependency (ElevenLabs), which are crucial behavioral traits. However, it lacks details on error handling, rate limits, supported audio formats, or output behavior (e.g., file generation specifics). The description adds value but doesn't fully compensate for the absence of annotations.

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 extremely concise and well-structured: a clear purpose statement followed by a critical warning. Both sentences earn their place by providing essential information without redundancy. The warning is appropriately front-loaded with an emoji for emphasis, making it easy to scan and understand quickly.

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 the tool's complexity (audio transformation with external API), no annotations, no output schema, and 0% schema coverage, the description is incomplete. It covers the core purpose and cost warning well but misses details on parameters, output format, error cases, and technical constraints. The cost warning is valuable but doesn't fully address the gaps for a tool with 3 parameters and no structured documentation.

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

Parameters2/5

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

Schema description coverage is 0%, so the description must compensate for parameter documentation. It mentions 'using provided audio files' which hints at 'input_file_path', but doesn't explain what 'voice_name' or 'output_directory' do, their formats, or constraints. With 3 parameters and no schema descriptions, this leaves significant gaps in understanding parameter roles and usage.

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 tool's purpose: 'Transform audio from one voice to another using provided audio files.' This specifies the verb ('transform'), resource ('audio'), and transformation type ('from one voice to another'), making the function unambiguous. However, it doesn't explicitly differentiate from sibling tools like 'voice_clone' or 'text_to_voice', which prevents a perfect score.

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

Usage Guidelines5/5

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

The description provides explicit usage guidance with the cost warning: 'Only use when explicitly requested by the user.' This clearly defines when to use the tool (when user explicitly requests voice transformation) and when not to use it (for other audio processing needs), addressing the critical cost implication. No alternatives are named, but the constraint is sufficiently directive.

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