Skip to main content
Glama
allvoicelab

All Voice Lab MCP Server

Official
by allvoicelab

speech_to_speech

Convert audio files to different voices while preserving speech content. Transform MP3 or WAV files using voice IDs with adjustable similarity and optional background noise removal.

Instructions

[AllVoiceLab Tool] Convert audio to another voice while preserving speech content.

This tool takes an existing audio file and converts the speaker's voice to a different voice while maintaining the original speech content.

Args:
    audio_file_path: Path to the source audio file. Only MP3 and WAV formats are supported. Maximum file size: 50MB.
    voice_id: Voice ID to use for the conversion. Required. Must be a valid voice ID from the available voices (use get_voices tool to retrieve).
    similarity: Voice similarity factor, range [0, 1], where 0 is least similar and 1 is most similar to the original voice characteristics. Default value is 1.
    remove_background_noise: Whether to remove background noise from the source audio before conversion. Default is False.
    output_dir: Output directory for the generated audio file. Default is user's desktop.
    
Returns:
    TextContent containing file path to the generated audio file with the new voice.
    
Limitations:
    - Only MP3 and WAV formats are supported
    - Maximum file size: 50MB
    - File must exist and be accessible

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
audio_file_pathYes
voice_idYes
similarityNo
remove_background_noiseNo
output_dirNo

Implementation Reference

  • The main handler function for the speech_to_speech tool. It validates inputs, calls the AllVoiceLab client to perform the voice conversion, and returns the output file path or error.
    def speech_to_speech(
        audio_file_path: str,
        voice_id: str,
        similarity: float = 1,
        remove_background_noise: bool = False,
        output_dir: str = None
    ) -> TextContent:
        """
        Convert audio to another voice while preserving speech content
        
        Args:
            audio_file_path: Path to the source audio file. Only MP3 and WAV formats are supported. Maximum file size: 50MB.
            voice_id: Voice ID to use for the conversion. Required. Must be a valid voice ID from the available voices (use get_voices tool to retrieve).
            similarity: Voice similarity factor, range [0, 1], where 0 is least similar and 1 is most similar to the original voice characteristics. Default value is 1.
            remove_background_noise: Whether to remove background noise from the source audio before conversion. Default is False.
            output_dir: Output directory for the generated audio file. Default is user's desktop.
            
        Returns:
            TextContent: Contains the file path to the generated audio file with the new voice.
        """
        all_voice_lab = get_client()
        output_dir = all_voice_lab.get_output_path(output_dir)
        logging.info(f"Tool called: speech_to_speech, voice_id: {voice_id}, similarity: {similarity}")
        logging.info(f"Audio file path: {audio_file_path}, remove background noise: {remove_background_noise}")
        logging.info(f"Output directory: {output_dir}")
    
        # Validate audio file
        is_valid, error_message = validate_audio_file(audio_file_path)
        if not is_valid:
            return create_error_response(error_message)
    
        # Validate voice_id parameter
        if not voice_id:
            logging.warning("voice_id parameter is empty")
            return create_error_response("voice_id parameter cannot be empty")
    
        # Validate voice_id format (basic check)
        if not isinstance(voice_id, str) or len(voice_id.strip()) == 0:
            logging.warning(f"Invalid voice_id format: {voice_id}")
            return create_error_response("Invalid voice_id format")
    
        # Validate similarity range
        if similarity < 0 or similarity > 1:
            logging.warning(f"Similarity parameter {similarity} is out of range [0, 1]")
            return create_error_response("similarity parameter must be between 0 and 1")
    
        # Validate and create output directory
        is_valid, error_message = validate_output_directory(output_dir)
        if not is_valid:
            return create_error_response(error_message)
    
        try:
            logging.info("Starting speech conversion processing")
            file_path = all_voice_lab.speech_to_speech(audio_file_path, voice_id, output_dir, similarity,
                                                       remove_background_noise)
            logging.info(f"Speech conversion successful, file saved at: {file_path}")
            return create_success_response(f"Audio conversion completed, file saved at: {file_path}\n")
        except FileNotFoundError as e:
            logging.error(f"Audio file does not exist: {audio_file_path}, error: {str(e)}")
            return create_error_response(f"Audio file does not exist: {audio_file_path}")
        except Exception as e:
            logging.error(f"Speech conversion failed: {str(e)}")
            return create_error_response("Conversion failed, tool temporarily unavailable")
  • The MCP tool registration for speech_to_speech, including name, description with input schema, and binding to the handler function.
    mcp.tool(
        name="speech_to_speech",
        description="""[AllVoiceLab Tool] Convert audio to another voice while preserving speech content.
        
        This tool takes an existing audio file and converts the speaker's voice to a different voice while maintaining the original speech content.
        
        Args:
            audio_file_path: Path to the source audio file. Only MP3 and WAV formats are supported. Maximum file size: 50MB.
            voice_id: Voice ID to use for the conversion. Required. Must be a valid voice ID from the available voices (use get_voices tool to retrieve).
            similarity: Voice similarity factor, range [0, 1], where 0 is least similar and 1 is most similar to the original voice characteristics. Default value is 1.
            remove_background_noise: Whether to remove background noise from the source audio before conversion. Default is False.
            output_dir: Output directory for the generated audio file. Default is user's desktop.
            
        Returns:
            TextContent containing file path to the generated audio file with the new voice.
            
        Limitations:
            - Only MP3 and WAV formats are supported
            - Maximum file size: 50MB
            - File must exist and be accessible
        """
    )(speech_to_speech)
Behavior4/5

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

With no annotations provided, the description carries full burden and does well by disclosing key behavioral traits: format limitations (MP3/WAV only), file size limits (50MB), accessibility requirements, output location defaults, and return format (TextContent with file path). It doesn't mention rate limits or authentication needs, but covers most operational constraints.

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?

Perfectly structured and front-loaded: purpose statement first, then organized sections (Args, Returns, Limitations) with zero wasted sentences. Every section adds value, and the information density is high without being verbose.

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

Completeness5/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 processing with multiple parameters) and no annotations/output schema, the description provides complete context: clear purpose, detailed parameter semantics, return format, and operational limitations. The agent has everything needed to correctly invoke this tool without needing additional documentation.

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

Parameters5/5

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

With 0% schema description coverage, the description fully compensates by providing detailed semantics for all 5 parameters: format constraints for audio_file_path, validation requirements for voice_id, range explanation for similarity, default behavior for remove_background_noise, and default location for output_dir. Each parameter's purpose and constraints are clearly explained.

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

Purpose5/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 with specific verb ('convert') and resource ('audio to another voice'), distinguishing it from siblings like text_to_speech (text input) and clone_voice (different voice transformation). The opening sentence precisely defines the transformation while preserving content.

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

Usage Guidelines4/5

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

The description provides clear context for when to use this tool (voice conversion of existing audio) and references the get_voices tool for obtaining valid voice IDs. However, it doesn't explicitly state when NOT to use it versus alternatives like clone_voice or text_to_speech, which would require explicit comparison.

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/allvoicelab/AllVoiceLab-MCP'

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