Skip to main content
Glama

Measure peak and average level

measure_volume_of_file
Read-onlyIdempotent

Measures a media file's audio sample levels via ffmpeg, returning peak/RMS dBFS and headroom to check clipping risk and set gain.

Instructions

Measure the plain sample level of a file's audio (ffmpeg volumedetect): max_volume_db is the highest sample peak in dBFS (0 = full scale, clipping risk), mean_volume_db the RMS level in dBFS. Also returns headroom_db, the gain that would bring the peak to 0 dBFS. Faster than measure_loudness_of_file, which is the tool for LUFS delivery targets. 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_volume_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.
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.6/5.0
Behavior5/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, destructiveHint=false and openWorldHint=false, so the description only needs to add context — and it does: it discloses the ffmpeg/ffprobe external prerequisite, the FFMPEG_NOT_FOUND failure mode, the on-disk (not timeline) operating scope, and the meaning of the three returned values including clipping risk at 0 dBFS. That is materially more than the annotations convey.

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?

The core purpose and the volume semantics come first, followed by the sibling comparison and then the environment constraints — a sensible front-loaded order with essentially no filler sentences. It is dense but each clause carries information; the only slight cost is a run-on quality that mixes return-value semantics with environment caveats in one block.

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?

There is no output schema, and the description compensates by defining max_volume_db, mean_volume_db and headroom_db precisely, including units (dBFS) and the 0 = full scale clipping boundary. Combined with the dependency and error note, an agent has everything needed to call this tool and interpret the result.

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?

Schema description coverage is 100%, so path, start, end, audio_stream and timeout_seconds are all documented in the schema with defaults, bounds and clamping behaviour. The description adds no parameter-level meaning beyond that (no mention of start/end windows or stream selection), so the baseline 3 applies.

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 plain sample level of a file's audio') and immediately grounds it in the underlying mechanism (ffmpeg volumedetect). It also names the sibling it is not, measure_loudness_of_file, and explains the difference (sample peak/RMS vs LUFS), so an agent can distinguish the two without opening either 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?

Explicit routing guidance: 'Faster than measure_loudness_of_file, which is the tool for LUFS delivery targets' tells the agent exactly when to prefer this tool and when to switch. It further scopes usage with 'Works on the file on disk with ffmpeg, not on the timeline; Premiere Pro is not needed', removing a plausible but wrong usage assumption.

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