Skip to main content
Glama
misbahsy

Video & Audio Editing MCP Server

by misbahsy

set_audio_channels

Modify audio channel configuration by setting mono (1 channel) or stereo (2 channels) layouts for an audio file, ensuring compatibility with specific playback or editing requirements.

Instructions

Sets the number of channels for an audio file (1 for mono, 2 for stereo). Args: input_audio_path: Path to the source audio file. output_audio_path: Path to save the audio file with the new channel layout. channels: Number of audio channels (1 for mono, 2 for stereo). Returns: A status message indicating success or failure.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
channelsYes
input_audio_pathYes
output_audio_pathYes

Implementation Reference

  • Handler function for the 'set_audio_channels' MCP tool. Uses FFmpeg to change the number of audio channels (mono/stereo) in an audio file and returns a success/error message.
    @mcp.tool()
    def set_audio_channels(input_audio_path: str, output_audio_path: str, channels: int) -> str:
        """Sets the number of channels for an audio file (1 for mono, 2 for stereo).
        Args:
            input_audio_path: Path to the source audio file.
            output_audio_path: Path to save the audio file with the new channel layout.
            channels: Number of audio channels (1 for mono, 2 for stereo).
        Returns:
            A status message indicating success or failure.
        """
        try:
            ffmpeg.input(input_audio_path).output(output_audio_path, ac=channels).run(capture_stdout=True, capture_stderr=True)
            return f"Audio channels set to {channels} and saved to {output_audio_path}"
        except ffmpeg.Error as e:
            error_message = e.stderr.decode('utf8') if e.stderr else str(e)
            return f"Error setting audio channels: {error_message}"
        except FileNotFoundError:
            return f"Error: Input audio file not found at {input_audio_path}"
        except Exception as e:
            return f"An unexpected error occurred: {str(e)}"
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 states the tool modifies audio files (implied mutation) and describes input/output paths, but doesn't disclose important behavioral traits like whether it overwrites existing files, what permissions are needed, error conditions, or performance characteristics. The return value description is minimal ('status message indicating success or failure').

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

Conciseness4/5

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

The description is well-structured with clear sections (purpose, Args, Returns) and front-loaded with the core functionality. Each sentence earns its place, though the return value description could be slightly more informative. The formatting with clear section headers enhances readability.

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 a mutation tool with 3 parameters, 0% schema coverage, no annotations, and no output schema, the description does a reasonable job but has gaps. It explains parameters well and states the basic purpose, but lacks details about file format compatibility, error handling, side effects, or what the status message contains. For a tool that modifies files, more behavioral context would be helpful.

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 clear semantic explanations for all 3 parameters: it explains what each path parameter represents (source vs. destination), clarifies the meaning of 'channels' with specific values (1 for mono, 2 for stereo), and documents the return value. This adds significant value beyond the bare schema.

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 a specific verb ('Sets') and resource ('number of channels for an audio file'), including the specific channel options (1 for mono, 2 for stereo). It distinguishes itself from sibling tools like 'set_audio_bitrate' or 'set_audio_sample_rate' by focusing specifically on channel configuration rather than other audio properties.

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

Usage Guidelines3/5

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

The description implies usage context through the parameter explanations (e.g., '1 for mono, 2 for stereo'), but doesn't explicitly state when to use this tool versus alternatives like 'set_video_audio_track_channels' or other audio manipulation tools. No explicit exclusions or prerequisites are mentioned.

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

Related 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/misbahsy/video-audio-mcp'

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