Skip to main content
Glama

Detect clipping and hot peaks

detect_clipping
Read-only

Checks audio or video files for digital clipping, sample/true peaks, flat-factor runs, and time ranges exceeding a true-peak threshold to prevent distortion after MP3/AAC encoding.

Instructions

Check for digital clipping and peaks that will distort after MP3/AAC encoding: sample peak, true peak, flat factor (runs of samples stuck at full scale), and the time ranges where the true peak crosses a threshold.

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": "detect_clipping"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYesAbsolute path to a local audio or video file. ~ is expanded.
startNoOnly analyse from this time (seconds or HH:MM:SS).
durationNoOnly analyse this many seconds.
max_rowsNo
audio_streamNoWhich audio stream to use if the file has several (0 = first).
threshold_dbtpNoReport ranges where the frame true peak reaches this level.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.8/5.0
Behavior4/5

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

readOnlyHint already declares this is a safe read, so the description focuses on substance: it names the four measurements taken and discloses that it returns time ranges where true peak crosses a threshold, which is real behavioral detail beyond the annotation. It omits cost/runtime expectations and does not say what a 'row' in the result represents.

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?

A single front-loaded sentence naming the purpose first and the metrics after; the parenthetical on flat factor earns its place by defining a non-obvious term. It is dense rather than padded, though a bulleted metric list would have been easier to scan.

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

Completeness3/5

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

With six parameters, no output schema, and only a readOnlyHint, the description covers what is measured but not the shape of the result — max_rows implies a tabular return yet neither the row structure nor the meaning of the threshold-crossing entries is described. Adequate for deciding to call it, thin for interpreting the call's configuration.

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 83%, so baseline is 3 and the schema already documents path, start, duration, max_rows, audio_stream, and threshold_dbtp. The description adds modest value by tying 'threshold' to the true-peak range reporting, but says nothing about the row cap, stream selection, or time-window parameters.

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 (check) and precise resource (digital clipping and peaks that distort after MP3/AAC encoding), then enumerates the exact measurements: sample peak, true peak, flat factor, and threshold-crossing time ranges. An agent can immediately tell this apart from loudness or silence tools without opening the schema.

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?

Usage is implied by the framing 'peaks that will distort after MP3/AAC encoding', which tells the agent this belongs in a pre-encode QC step. However, no explicit when-to-use/when-not statements appear, and no sibling such as detect_silence or check_loudness_targets is named as an alternative for adjacent QA questions.

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