Skip to main content
Glama

Join media files end to end

concat_media_files

Join two or more video or audio files into one output file in the order given, re-encoding mixed formats or copying identical formats without re-encoding.

Instructions

Join two or more media files into one new file, in the order given. mode "reencode" (default) works for any mix of sizes, frame rates and codecs: every file is scaled and padded to one frame size and frame rate (default: those of the first file), only the first audio stream of each file is used (stereo 48 kHz), files without sound get silence, still images last 5 s each, and the result is H.264 + AAC (.mp4/.mov/.mkv) or, for audio-only inputs, the container's default codec (24-bit PCM for .wav). mode "copy" joins without re-encoding and only works when all files have identical codecs, size, frame rate and audio format (for example segments from one camera). Mixing video files with audio-only files fails with BAD_ARGS. Returns the new file's duration and streams, file_count and sum_of_source_durations. To put clips one after another in a sequence use add_clips_sequentially instead. Works on the file on disk with ffmpeg, not on the timeline; Premiere Pro is not needed. ffmpeg and ffprobe must be installed (see check_ffmpeg), else FFMPEG_NOT_FOUND.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "paths": "<paths>",
      "output_path": "<output_path>"
    },
    "name": "concat_media_files"
  }
}

Input Schema

NameRequiredDescriptionDefault
fpsNoFrame rate of the result in frames per second (reencode mode only). Default: the first file's frame rate (30 when it is a still).
modeNo"reencode" = normalise and encode (default; handles mixed formats). "copy" = no re-encoding, identical formats only.
pathsYesAbsolute paths of the 2-50 files to join, in order. Either all with video or all audio-only.
widthNoFrame width of the result in pixels, rounded to even (reencode mode only). Default: the first file's width.
heightNoFrame height of the result in pixels, rounded to even (reencode mode only). Default: the first file's height.
overwriteNoReplace output_path if it already exists. Default false: an existing file makes the tool fail with FILE_EXISTS.
output_pathYesAbsolute path of the file to write; must not be one of the inputs. The extension chooses the container.
timeout_secondsNoStop ffmpeg and fail with TIMEOUT after this many seconds. Default 3600.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.8/5.0
Behavior5/5

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

Annotations only declare mutation and non-idempotency; the description supplies the real behavioral picture: scaling/padding to a single frame size and rate, first audio stream only at stereo 48 kHz, silence for silent inputs, 5 s per still image, output codecs per container, and the FFMPEG_NOT_FOUND prerequisite. It even documents the return payload (duration, streams, file_count, sum_of_source_durations), which no output schema provides.

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?

Front-loaded with purpose, then mode behavior, then failure/prerequisite notes; every sentence carries information a caller needs. It is a single dense block rather than scannable bullets, which slightly hurts readability given the volume of detail, but there is no filler.

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?

For an 8-parameter, mutation-heavy ffmpeg wrapper with no output schema, the description covers inputs, mode semantics, error codes, external dependency checks, return fields, and the sibling alternative. Nothing an agent needs to invoke it correctly or interpret failure is missing.

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 coverage is 100%, so the baseline is 3; the description still adds conceptual meaning by explaining that width/height/fps apply only in reencode mode and default to the first file's values, and by characterizing what 'copy' actually guarantees. It stops short of per-parameter detail beyond that, but the defaults and mode coupling are clear.

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?

States a specific verb and resource ('Join two or more media files into one new file, in the order given') and immediately scopes the operation to files on disk rather than the timeline. It explicitly distinguishes itself from the sibling add_clips_sequentially, so an agent can route correctly without opening a schema.

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?

Gives explicit when-to-use guidance for both modes: 'reencode' for any mix of sizes, frame rates and codecs, 'copy' only when all files share identical codecs, size, frame rate and audio format (e.g. segments from one camera). It also names the failure case (mixing video with audio-only fails with BAD_ARGS) and points to add_clips_sequentially for timeline sequencing.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools