Skip to main content
Glama

Detect silence in a file

detect_silence_in_file
Read-onlyIdempotent

Detect silent and non-silent audio ranges in a media file to identify cut points for removing silence or tightening edits.

Instructions

Find the silent parts of a media file's audio (ffmpeg silencedetect). Returns silent ranges and the complementary non_silent ranges, each as {start, end, duration} in file time (seconds from the start of the file), plus counts and total seconds. Typical use: analyse the source file of a clip, then cut the silent ranges out of the timeline with extract_range or razor_at_times (for a clip at 100 % speed: sequence time = clip start + file time - clip in point). A part counts as silent when every channel stays below noise_db for at least min_duration. Use padding to keep a little room around speech. Fails with NO_AUDIO for a file without sound. 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": "detect_silence_in_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.
paddingNoSeconds of each silence to give back to the surrounding sound on both sides, so cuts do not clip the start or end of words. Default 0.
noise_dbNoLevel below which audio counts as silence, in dBFS. Default -30. Use about -40 for clean studio recordings, -25 for noisy rooms.
max_resultsNoMaximum ranges per list to return. When there are more, the result has truncated=true and the total count. Default 500.
audio_streamNoWhich audio stream to use, 0-based among the file's audio streams (see probe_media_file). Default 0.
min_durationNoShortest silence to report, in seconds. Default 0.5.
timeout_secondsNoStop ffmpeg and fail with TIMEOUT after this many seconds. Default 300.
min_non_silent_durationNoDrop non-silent ranges shorter than this many seconds (clicks, pops). Default 0.

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?

Annotations already declare readOnly/idempotent/non-destructive, but the description adds real behavior beyond them: named failure modes (NO_AUDIO, FFMPEG_NOT_FOUND, TIMEOUT), the external dependency requirement with a routing hint to check_ffmpeg, the detection rule (every channel below noise_db for at least min_duration), and the purpose of padding. It also pre-empts a likely misconception by clarifying that the timeline/Premiere is not involved.

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 important facts — what it finds, what it returns, then the typical use — are front-loaded, and nearly every sentence carries operational value. It is a single dense paragraph, though, with error codes and dependency notes trailing at the end; light structuring would improve scanability without cutting content.

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?

For a 10-parameter tool with no output schema, the description covers the return shape, units (seconds from start of file), the truncation-relevant counts, failure modes, and the time-mapping needed to act on results. Nothing an agent needs to call it correctly or use the output 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, but the description genuinely adds meaning: it explains the semantic rule behind noise_db and min_duration, explains that padding gives room back to surrounding sound so cuts don't clip words, and offers tuning advice (-40 for clean studio, -25 for noisy rooms). It doesn't add guidance for the remaining parameters (max_results, audio_stream, timeout_seconds), so it stops short of a 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?

The description gives a specific verb and resource ("Find the silent parts of a media file's audio"), names the underlying mechanism (ffmpeg silencedetect), and states exactly what is returned (`silent` and `non_silent` ranges as {start, end, duration}). This clearly separates it from siblings like detect_beats_in_file or detect_scene_changes_in_file, which operate on different signal types.

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?

It prescribes a concrete workflow: analyse the source file of a clip, then cut with extract_range or razor_at_times, and even supplies the time-mapping formula (sequence time = clip start + file time - clip in point). It also states the boundary condition explicitly — it works on the on-disk file, not the timeline and does not need Premiere.

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