Skip to main content
Glama

Detect black frames in a file

detect_black_frames_in_file
Read-onlyIdempotent

Detect black segments in video files to locate fades, slugs, missing media, or act breaks for export quality control; returns start, end, and duration for each black range.

Instructions

Find the parts of a video file where the picture is black (ffmpeg blackdetect): fades to black, slugs, missing media in an export. Returns black ranges as {start, end, duration} in file time (seconds from the start of the file), black_count and black_seconds. Use it for quality control of an export or to find act breaks. detect_letterbox_in_file finds black bars instead. 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_black_frames_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.
max_resultsNoMaximum ranges to return. When there are more, the result has truncated=true and the total count. Default 500.
min_durationNoShortest black stretch to report, in seconds. Default 0.1.
timeout_secondsNoStop ffmpeg and fail with TIMEOUT after this many seconds. Default 600.
picture_black_ratioNoFraction of the pixels (0-1) that must be black for a frame to count as black. Default 0.98.
pixel_black_thresholdNoLuminance (0-1) below which a pixel counts as black. Default 0.1.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, destructiveHint=false and closed-world scope, so the safety profile is covered. The description still adds real substance beyond them: an external ffmpeg/ffprobe dependency, a named failure mode (FFMPEG_NOT_FOUND) with a pointer to check_ffmpeg, and the shape of the returned ranges (start/end/duration in seconds from file start, plus black_count and black_seconds). It stops short of describing cost/runtime characteristics beyond pointing at the timeout parameter.

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 the core purpose, then return shape, then sibling disambiguation, then prerequisites and failure mode — a sensible order for an agent deciding whether to call. No filler sentences; each clause carries either scope, output, alternative routing, or an error condition.

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 an 8-parameter analysis tool with no output schema, the description supplies what the schema cannot: the return payload fields, units and origin of time values, the ffmpeg environment prerequisite, the not-on-timeline constraint, and the specific error string. An agent has enough to call it correctly and to 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%, with per-parameter descriptions for start, end, min_duration, picture_black_ratio, pixel_black_threshold, max_results and timeout_seconds. The description's mention of 'file time (seconds from the start of the file)' reinforces the start/end semantics but adds no tuning guidance for the detection thresholds. Baseline 3 for a fully documented schema.

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 ('Find the parts of a video file where the picture is black') plus concrete examples of what that means (fades to black, slugs, missing media). It explicitly separates itself from detect_letterbox_in_file, so an agent can pick the right detector 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?

Gives both a when-to-use context (quality control of an export, finding act breaks) and an explicit exclusion with the alternative named ('detect_letterbox_in_file finds black bars instead'). It also states the execution substrate (file on disk, not the timeline, Premiere not needed), which rules out a whole class of misuse.

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