Skip to main content
Glama

Measure loudness (EBU R128)

measure_loudness_of_file
Read-onlyIdempotent

Measures EBU R128/ITU-R BS.1770 loudness (LUFS, range, true peak) in a file to check mixes and exports against streaming, podcast, or broadcast targets.

Instructions

Measure the programme loudness of a file's audio the EBU R128 / ITU-R BS.1770 way: integrated loudness in LUFS, loudness range in LU and true peak in dBTP. Use it to check a mix or an export against a delivery target (-14 LUFS for streaming music, -16 for podcasts, -23 for EBU broadcast, -24 for ATSC). With target_lufs it also returns gain_to_target_db and the true peak after that gain (apply the gain with adjust_clip_volume, or use normalize_audio_file to write a corrected file). silent=true when the audio is too quiet to measure. For plain peak and average level use measure_volume_of_file. 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>"
    },
    "name": "measure_loudness_of_file"
  }
}

Input Schema

NameRequiredDescriptionDefault
endNoAnalyse up to this file time, in seconds; clamped to the file's length. Must be greater than start. Default: the end of the file.
pathYesAbsolute path of the media file on this computer.
startNoAnalyse from this file time (seconds from the start of the file). Default 0.
target_lufsNoLoudness target in LUFS, -70 to 0. When given, the result includes gain_to_target_db. Omit for the measurement only.
audio_streamNoWhich audio stream to use, 0-based among the file's audio streams (see probe_media_file). Default 0.
timeout_secondsNoStop ffmpeg and fail with TIMEOUT after this many seconds. Default 600.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.9/5.0
Behavior5/5

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

Goes well beyond the readOnly/idempotent annotations: discloses that it operates on the file on disk via ffmpeg rather than the timeline, that Premiere Pro is not required, that ffmpeg/ffprobe must be installed and the specific FFMPEG_NOT_FOUND failure, that a TIMEOUT can occur, and that silent=true is returned for audio too quiet to measure. These are exactly the operational facts an agent needs before calling.

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-loads what is measured and in what units, then targets, then the gain workflow, then tool routing, then environment prerequisites. Every sentence carries distinct information — dependency and error code are last because they are conditional, not 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?

No output schema exists, and the description fully compensates by naming every returned value (integrated LUFS, loudness range in LU, true peak in dBTP, gain_to_target_db, post-gain true peak, silent flag). Combined with the ffmpeg dependency note and error semantics, nothing an agent needs to call this correctly 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 earns above that by explaining the consequence of target_lufs (returns gain_to_target_db and the true peak after that gain), which the schema only partly states. It does not add meaning for start/end, audio_stream, or timeout_seconds beyond what the schema already says, so it is not a full 5.

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 ("measure the programme loudness of a file's audio") and pins the standard (EBU R128 / ITU-R BS.1770) plus the exact metrics returned (LUFS, LU, dBTP). It explicitly distinguishes itself from the nearest sibling: "For plain peak and average level use measure_volume_of_file."

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 a concrete use case (checking a mix or export against a delivery target) with actual target values for four delivery contexts. Names alternatives for each follow-on action: adjust_clip_volume to apply gain, normalize_audio_file to write a corrected file, measure_volume_of_file for plain levels, check_ffmpeg for the dependency. When-to-use and when-to-use-something-else are both explicit.

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