Skip to main content
Glama

Normalize loudness to a new file

normalize_audio_file

Normalize an audio file's loudness to a target LUFS with EBU R128 and true-peak limiting, writing a new file while leaving the source unchanged.

Instructions

Write a copy of a file's audio with its loudness brought to a target in LUFS (EBU R128, ffmpeg loudnorm, two passes: measure, then correct with a true-peak limit). The whole file is processed (no time range) and only the chosen audio stream is written. The source is not changed. Output .wav (24-bit PCM) or another audio extension; with a .mp4/.mov/.mkv output the video stream is copied and the audio is AAC. Returns before and after loudness (after is measured on the new file), gain_db and method (linear, or dynamic when loudnorm had to compress). To change loudness without a new file, measure with measure_loudness_of_file and use adjust_clip_volume. 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": {
      "path": "<path>",
      "output_path": "<output_path>"
    },
    "name": "normalize_audio_file"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYesAbsolute path of the media file on this computer.
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, e.g. .wav; must differ from path. The extension chooses the format.
target_lufsNoIntegrated loudness target in LUFS, -70 to -5. Default -16 (podcasts, online video). -14 streaming music, -23 EBU broadcast.
audio_streamNoWhich audio stream to use, 0-based among the file's audio streams (see probe_media_file). Default 0.
true_peak_dbNoHighest true peak allowed, in dBTP, -9 to 0. Default -1.5.
loudness_rangeNoLoudness range target in LU, 1-50 (how much dynamics to keep when compression is needed). Default 11.
timeout_secondsNoStop ffmpeg and fail with TIMEOUT after this many seconds. Default 1800.

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?

Goes well past the annotations: the source file is not changed, only the selected audio stream is written, video is copied for .mp4/.mov/.mkv with AAC audio, .wav is 24-bit PCM, and an existing output fails unless overwrite is set. It also discloses the two-pass measure-then-correct method and that the after-loudness is measured on the new file, plus the FFMPEG_NOT_FOUND failure mode.

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 the core action, and nearly every sentence carries distinct information (format rules, returns, alternative, prerequisites). It is dense to the point of reading as one long block, slightly reducing scannability, but no sentence is 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?

With no output schema, the description takes on the burden of describing returns (before/after loudness, gain_db, method) and does so. Combined with the format rules, alternatives, and dependency/error notes, an agent has everything needed to invoke it correctly.

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 schema already documents the parameters; the description still adds interpretive value by explaining that the extension chooses the format, that the chosen audio stream is the only one written, and that the true-peak limit and linear-vs-dynamic method shape the result.

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 precise verb and resource: write a copy of a file's audio with loudness brought to a target in LUFS, via EBU R128 two-pass loudnorm. It clearly distinguishes itself from siblings by naming measurement and volume-adjustment tools for the non-copy case.

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?

Explicitly says when not to use it ('To change loudness without a new file, measure with measure_loudness_of_file and use adjust_clip_volume'), that it works on disk rather than the timeline, and that Premiere Pro is not required. It also sets the ffmpeg/ffprobe prerequisite with the concrete error code.

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