Skip to main content
Glama
misbahsy

Video & Audio Editing MCP Server

by misbahsy

set_audio_bitrate

Adjust the audio bitrate of a file to a specified target value. Input the source file, define the target bitrate, and save the output for optimized audio quality in video and audio editing workflows.

Instructions

Sets the bitrate for an audio file. Args: input_audio_path: Path to the source audio file. output_audio_path: Path to save the audio file with the new bitrate. bitrate: Target audio bitrate (e.g., '128k', '192k', '320k'). Returns: A status message indicating success or failure.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bitrateYes
input_audio_pathYes
output_audio_pathYes

Implementation Reference

  • MCP tool handler that sets the audio bitrate of an input file using FFmpeg and saves the output.
    @mcp.tool()
    def set_audio_bitrate(input_audio_path: str, output_audio_path: str, bitrate: str) -> str:
        """Sets the bitrate for an audio file.
        Args:
            input_audio_path: Path to the source audio file.
            output_audio_path: Path to save the audio file with the new bitrate.
            bitrate: Target audio bitrate (e.g., '128k', '192k', '320k').
        Returns:
            A status message indicating success or failure.
        """
        try:
            ffmpeg.input(input_audio_path).output(output_audio_path, audio_bitrate=bitrate).run(capture_stdout=True, capture_stderr=True)
            return f"Audio bitrate set to {bitrate} 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 bitrate: {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 action ('Sets') and return type ('status message'), but lacks critical details like whether it overwrites files, requires specific permissions, handles errors, or has performance implications. This is inadequate for a mutation tool with zero annotation coverage.

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 a purpose statement followed by Args and Returns sections. It's appropriately sized with no redundant information, though the 'Args' and 'Returns' labels are slightly verbose compared to integrating this into a single paragraph.

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 3 parameters with 0% schema coverage and no annotations or output schema, the description does a decent job explaining parameters and return type. However, as a mutation tool, it lacks details on file handling, error conditions, and behavioral constraints, making it incomplete for safe agent use.

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?

Schema description coverage is 0%, so the description must compensate. It provides clear semantics for all three parameters: 'input_audio_path' as source, 'output_audio_path' as destination, and 'bitrate' with example values. This adds significant value beyond the bare schema, though it could include format details like accepted bitrate units.

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 with a specific verb ('Sets') and resource ('bitrate for an audio file'), making it easy to understand what it does. However, it doesn't explicitly differentiate from sibling tools like 'set_audio_sample_rate' or 'convert_audio_properties', which reduces it from 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 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. It doesn't mention sibling tools like 'set_audio_sample_rate' or 'convert_audio_properties' that might handle related audio modifications, leaving the agent without context for 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

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