Skip to main content
Glama

extract_audio

Extract audio from video files to create standalone audio files in formats like MP3 or AAC using FFmpeg processing.

Instructions

Extract audio from a video file

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
inputPathYesPath to the input video file
outputPathYesPath for the output audio file
formatYesAudio format (mp3, aac, etc.)

Implementation Reference

  • Handler function for the 'extract_audio' tool. Validates inputs, constructs FFmpeg command to extract audio without video (-vn -acodec), runs it, and returns completion message.
    case "extract_audio": {
      const inputPath = validatePath(String(args?.inputPath), true);
      const outputPath = validatePath(String(args?.outputPath));
      const format = String(args?.format || "mp3");
      
      await ensureDirectoryExists(outputPath);
      const command = `-i "${inputPath}" -vn -acodec ${format} "${outputPath}" -y`;
      const result = await runFFmpegCommand(command);
      
      return {
        content: [{
          type: "text",
          text: `Audio extraction completed: ${inputPath} → ${outputPath}\n\n${result}`
        }]
      };
    }
  • Input schema definition for the 'extract_audio' tool, specifying required parameters: inputPath, outputPath, and format.
    {
      name: "extract_audio",
      description: "Extract audio from a video file",
      inputSchema: {
        type: "object",
        properties: {
          inputPath: {
            type: "string",
            description: "Path to the input video file"
          },
          outputPath: {
            type: "string",
            description: "Path for the output audio file"
          },
          format: {
            type: "string",
            description: "Audio format (mp3, aac, etc.)"
          }
        },
        required: ["inputPath", "outputPath", "format"]
      }
    },
  • src/index.ts:46-50 (registration)
    Registration of all tools, including 'extract_audio', by returning the toolDefinitions array in response to ListToolsRequest.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      return {
        tools: toolDefinitions
      };
    });
Behavior2/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 but adds minimal context. It states the action ('extract audio') but doesn't describe traits like whether it overwrites existing files, requires specific permissions, handles errors, or has performance considerations (e.g., processing time). For a mutation tool (implied by file output) with zero annotation coverage, this is a significant gap in transparency.

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 with a single sentence that directly states the tool's purpose. It is front-loaded with no wasted words, making it easy to parse quickly. Every part of the sentence earns its place by clearly conveying the core functionality without redundancy or unnecessary elaboration.

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

Completeness2/5

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

Given the tool's complexity (a mutation operation with file I/O) and the lack of annotations and output schema, the description is incomplete. It doesn't address behavioral aspects like file handling, error conditions, or output specifics, which are crucial for safe and effective use. The high schema coverage helps with parameters, but overall context for invocation is insufficient.

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

Parameters3/5

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

The description adds no parameter-specific information beyond what the schema provides. Since schema description coverage is 100%, the baseline score is 3, as the schema already documents all parameters (inputPath, outputPath, format) adequately. The description doesn't compensate with additional details like format examples or path requirements, but it doesn't need to given the high schema coverage.

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 ('extract') and resource ('audio from a video file'), making it immediately understandable. It distinguishes from siblings like 'extract_frames' (which extracts images) and 'trim_audio' (which modifies audio), though it doesn't explicitly mention these distinctions. The purpose is unambiguous but could be more specific about sibling differentiation.

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 prerequisites (e.g., needing a video file), exclusions (e.g., not for audio-only files), or comparisons to siblings like 'convert_video' (which might handle audio extraction as part of conversion) or 'trim_audio' (which modifies existing audio). Usage is implied from the purpose but lacks explicit context.

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/sworddut/mcp-ffmpeg-helper'

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