Skip to main content
Glama

Analyze recording for black/dim frames

mobile_analyze_recording

Analyze an MP4 recording to measure mean grayscale, detect black or dim runs, and classify frames into brightness buckets for Android UI diagnostics.

Instructions

Sample mean grayscale over an MP4 (ffmpeg), detect black/dim runs, and classify OEM-agnostic brightness buckets (true_black, near_black_content, system_launcher_idle, dark_app_ui, light_app_ui). Bucket ranges are heuristics—calibrate with exportSampleFrames on the device under test. Use mode='flash' for one-call regressions. Full per-frame timeline is omitted unless includeFullTimeline=true.

Input Schema

NameRequiredDescriptionDefault
fpsNo
modeNoflash: exportSampleFrames=true, timelineDownsampleMs=100, blackThreshold=16default
pathNo
marksNo
serialNoExact ADB serial from mobile_devices_list; never inferred when multiple devices exist
artifactUriNo
dimThresholdNo
blackThresholdNoMean gray below this counts as black (default 16 = true_black)
exportSampleFramesNo
includeFullTimelineNo
timelineDownsampleMsNo

Output Schema

NameRequiredDescriptionDefault
pathYes
marksYes
widthYes
heightYes
dimRunsYes
samplesYes
blackRunsYes
sampleFpsYes
durationMsYes
frameCountYes
hasDimFlashYes
maxDimRunMsYes
bucketCountsYes
dimThresholdYes
dimFrameCountYes
hasBlackFlashYes
maxBlackRunMsYes
blackThresholdYes
blackFrameCountYes
lastDimOffsetMsYes
timelineSummaryYes
dimRunsTruncatedYes
firstDimOffsetMsYes
meanGrayTimelineNo
lastBlackOffsetMsYes
blackRunsTruncatedYes
firstBlackOffsetMsYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.9.0
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • changedOutput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
  2. First observedv0.5.0

TDQS

A4.1/5.0
Behavior4/5

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

Adds substantive context beyond the annotations: the output is heuristic buckets that may need calibration, the timeline is omitted by default, and mode='flash' expands into a preset. Annotations mark readOnlyHint=false, and the mention of exportSampleFrames is consistent with producing artifacts, though the description never explicitly states that files are written.

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?

Three dense, front-loaded sentences with no filler; the core action leads and the calibration and defaults follow. The first sentence is long, but each clause carries distinct, useful information.

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

Completeness4/5

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

For an analysis tool with an output schema, the description covers the sampling method, bucketing semantics, calibration caveat, and key mode/timeline defaults. It omits the fact that readOnlyHint=false implies artifact writes, which is a minor gap given the structured fields already present.

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 coverage is low (27%) across 11 params, so the description must compensate. It clarifies mode='flash', includeFullTimeline, exportSampleFrames, and implicitly blackThreshold (16=true_black), but leaves fps, path, marks, serial, artifactUri, dimThreshold, and timelineDownsampleMs unexplained. Partial but incomplete compensation warrants the baseline 3.

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 specific verbs (sample, detect, classify) and resource (MP4 recording via ffmpeg), and enumerates the exact brightness buckets it produces. An agent can distinguish this analysis tool from capture/record siblings like mobile_screen_record or mobile_theme_flash_report 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 Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives clear context and a named alternative: calibrate heuristics with exportSampleFrames on the device under test, and use mode='flash' for one-call regressions. It stops short of explicit when-not-to-use guidance, but the routing signal is strong.

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