Skip to main content
Glama

adb_screenshot_diff

Compares the current Android screen to a saved baseline, detects pixel-level changes, and reports difference count, percentage, and changed region; a tolerance threshold ignores clocks or badges.

Instructions

Compare the current screen against a saved screenshot baseline. Decodes PNGs and performs pixel-level comparison (RGB channels), reporting exact pixel difference count, percentage, and the bounding box of the changed region. Supports a tolerance threshold for absorbing minor dynamic elements like clocks or notification badges.

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": {
      "baseline": "<baseline>"
    },
    "name": "adb_screenshot_diff"
  }
}

Input Schema

NameRequiredDescriptionDefault
deviceNoDevice serial
baselineYesBaseline name to compare against (from adb_screenshot_baseline)
result_handleNoOptional. If provided, store this tool's result under `result://<tool>/<name>` for retrieval after compaction. Name must be 1-32 chars, [a-zA-Z0-9_-]. Existing handles with the same tool+name are overwritten. Use adb_result_list to see active handles, adb_result_get or the MCP Resource URI to retrieve.
tolerancePercentNoPixel difference percentage threshold below which the result reports IDENTICAL. 0 = exact match required. 1-2 absorbs clock/status bar changes.
result_handle_ttlNoOptional. TTL in seconds for the result handle (60 to 604800). Default 43200 (12 hours). Ignored if result_handle is not provided.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.1.6
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
  2. Changed3 schema fields changedv1.1.3
    • removedInput schema / additionalProperties
      Removed value: -false
    • addedInput schema / properties / result_handle
      Added value: +{
      +  "description": "Optional. If provided, store this tool's result under `result://<tool>/<name>` for retrieval after compaction. Name must be 1-32 chars, [a-zA-Z0-9_-]. Existing handles with the same tool+name are overwritten. Use adb_result_list to see active handles, adb_result_get or the MCP Resource URI to retrieve.",
      +  "maxLength": 32,
      +  "minLength": 1,
      +  "pattern": "^[a-zA-Z0-9_-]+$",
      +  "type": "string"
      +}
    • addedInput schema / properties / result_handle_ttl
      Added value: +{
      +  "description": "Optional. TTL in seconds for the result handle (60 to 604800). Default 43200 (12 hours). Ignored if result_handle is not provided.",
      +  "maximum": 604800,
      +  "minimum": 60,
      +  "type": "integer"
      +}
  3. First observedv1.1.1

TDQS

A4/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does well: it discloses the comparison method (PNG decode, RGB-channel pixel diff), the exact outputs produced (differing pixel count, percentage, changed-region bounding box), and the tolerance behavior. It stops short of stating what happens when the baseline name does not exist, or explicitly that the screen is captured live at call time rather than read from a cached image.

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?

Three sentences, front-loaded with the action and its target, then mechanism, then the tolerance caveat. No filler and no sentence that could be removed without losing 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 a read-only, five-parameter tool with no output schema and no annotations, the definition covers the return values in prose (count, percentage, bounding box) and the tolerance knob, which is the important surface. Remaining gap is failure-mode behavior when the named baseline is absent, plus confirming the call performs a fresh capture.

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 the schema already documents device, baseline, tolerancePercent, and the result_handle/ttl mechanism, which sets the baseline at 3. The description reinforces tolerance semantics ("absorbing minor dynamic elements like clocks or notification badges") but adds no numeric guidance or usage rules beyond what the schema's own descriptions already say.

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?

"Compare the current screen against a saved screenshot baseline" gives a precise verb and object, and the follow-on sentences narrow it to PNG decoding plus pixel-level RGB comparison. The baseline parameter ties it explicitly to the adb_screenshot_baseline sibling, so an agent can tell capture, save-baseline, and compare apart without opening a 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 rather than stated: an agent infers this is the verification step after adb_screenshot_baseline, and the tolerance sentence hints at when noisy UI elements should be tolerated. But no sibling is named as the alternative, and near-neighbours like adb_snapshot_compare, adb_regression_check, and adb_thermal_compare are never mentioned to route the agent away.

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