Skip to main content
Glama

Normalize loudness

normalize_loudness

Create a loudness-corrected copy of an audio or video file: apply exact gain when it meets true-peak limits, otherwise use two-pass dynamic loudness normalization to hit LUFS and peak targets.

Instructions

Write a loudness-corrected copy. The file is measured first; if a plain gain change reaches the target without exceeding the true-peak ceiling, exactly that gain is applied (linear, dynamics untouched). Otherwise ffmpeg's two-pass dynamic loudnorm is used to hit both targets. Pick a target preset or give custom integrated LUFS / true-peak / LRA values. For video files the video stream is copied untouched. The result is re-measured. Never overwrites without overwrite: true.

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>"
    },
    "name": "normalize_loudness"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYesAbsolute path to a local audio or video file. ~ is expanded.
linearNoPrefer an exact gain change (keeps your mix's dynamics). If that would push true peak over the ceiling, dynamic loudnorm is used instead and the result explains why.
lra_luNoTarget loudness range used in dynamic mode.
targetNoPreset target. Ignored when integrated_lufs is given.
dry_runNoMeasure and return the pass-2 command without writing.
overwriteNo
output_pathNoOutput file; the extension picks the codec (.wav 24-bit, .flac, .mp3 320k, .m4a/.mp4/.mov AAC 256k, .opus). Defaults to <name>_<target>.<ext> next to the source.
sample_rateNoOutput sample rate. Defaults to the source rate (or 48000).
audio_streamNo
true_peak_dbtpNoCustom true-peak ceiling.
integrated_lufsNoCustom integrated loudness target.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.1/5.0
Behavior5/5

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

Goes well beyond the annotations: it discloses the two-path algorithm (exact linear gain when the true-peak ceiling allows, otherwise two-pass dynamic loudnorm), that video streams are copied untouched, that the result is re-measured, and that overwriting requires overwrite: true. This is consistent with readOnlyHint=false and destructiveHint=false, since a new file is written rather than the source destroyed.

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?

Front-loaded with the outcome, then the decision logic, then the target options and safety note. Dense but every sentence carries information an agent needs.

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

Completeness4/5

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

For an 11-parameter mutation tool with no output schema, the description covers the important behavior. It does not describe what the returned measurement or 'explains why' output looks like, and dry_run is left entirely to the schema.

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 already 82%, so the baseline is 3; the description adds real meaning on top by explaining the linear-vs-dynamic tradeoff and that presets are overridden by custom integrated_lufs values, which the schema only hints at.

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?

Opens with a specific verb and resource: 'Write a loudness-corrected copy.' The write-a-new-file framing implicitly separates it from measure_loudness, though no sibling is named explicitly.

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?

It explains how to choose a target ('Pick a target preset or give custom integrated LUFS / true-peak / LRA values') and when the linear path is taken, but never states when to use this tool versus measure_loudness or check_loudness_targets, nor when to prefer dry_run.

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