Skip to main content
Glama

Compare Screenshots

screenshot_diff

Compare two screenshots to highlight changed regions and return a diff image with its path, so QA teams can spot visual differences and investigate them further.

Instructions

Highlight changed regions between two screenshots. Returns the diff image and path; a visual difference is a lead, not a verdict.

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": {
      "before": "<before>",
      "after": "<after>"
    },
    "name": "screenshot_diff"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameNodiff
afterYes
beforeYes
thresholdNo

Output Schema

NameRequiredDescriptionDefault
dataNo
run_idYes
stagesNo
statusYes
recoveryNo
operationYes
error_codeYes
session_stateYes
schema_versionNo
progress_omittedNo
progress_delivery_failedNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changedv0.10.0
    • removedInput schema / properties / after / title
      Removed value: -"After"
    • removedInput schema / properties / before / title
      Removed value: -"Before"
    • removedInput schema / properties / name / title
      Removed value: -"Name"
    • removedInput schema / properties / threshold / title
      Removed value: -"Threshold"
    • removedInput schema / title
      Removed value: -"screenshot_diffArguments"
  2. Changed12 schema fields changed
    • removedOutput schema / properties / data / title
      Removed value: -"Data"
    • removedOutput schema / properties / error_code / title
      Removed value: -"Error Code"
    • removedOutput schema / properties / operation / title
      Removed value: -"Operation"
    • removedOutput schema / properties / progress_delivery_failed / title
      Removed value: -"Progress Delivery Failed"
    • removedOutput schema / properties / progress_omitted / title
      Removed value: -"Progress Omitted"
    • removedOutput schema / properties / recovery / title
      Removed value: -"Recovery"
    • removedOutput schema / properties / run_id / title
      Removed value: -"Run Id"
    • removedOutput schema / properties / schema_version / title
      Removed value: -"Schema Version"
    • removedOutput schema / properties / session_state / title
      Removed value: -"Session State"
    • removedOutput schema / properties / stages / title
      Removed value: -"Stages"
    • removedOutput schema / properties / status / title
      Removed value: -"Status"
    • removedOutput schema / title
      Removed value: -"AgentResult"
  3. Changed1 schema field changedv0.5.2
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "data": {
      +      "additionalProperties": true,
      +      "title": "Data",
      +      "type": "object"
      +    },
      +    "error_code": {
      +      "anyOf": [
      +        {
      +          "type": "string"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "title": "Error Code"
      +    },
      +    "operation": {
      +      "title": "Operation",
      +      "type": "string"
      +    },
      +    "progress_delivery_failed": {
      +      "default": false,
      +      "title": "Progress Delivery Failed",
      +      "type": "boolean"
      +    },
      +    "progress_omitted": {
      +      "default": 0,
      +      "title": "Progress Omitted",
      +      "type": "integer"
      +    },
      +    "recovery": {
      +      "items": {
      +        "type": "string"
      +      },
      +      "title": "Recovery",
      +      "type": "array"
      +    },
      +    "run_id": {
      +      "anyOf": [
      +        {
      +          "type": "string"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "title": "Run Id"
      +    },
      +    "schema_version": {
      +      "const": 1,
      +      "default": 1,
      +      "title": "Schema Version",
      +      "type": "integer"
      +    },
      +    "session_state": {
      +      "title": "Session State",
      +      "type": "string"
      +    },
      +    "stages": {
      +      "items": {
      +        "type": "string"
      +      },
      +      "title": "Stages",
      +      "type": "array"
      +    },
      +    "status": {
      +      "enum": [
      +        "completed",
      +        "error"
      +      ],
      +      "title": "Status",
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "operation",
      +    "status",
      +    "session_state",
      +    "run_id",
      +    "error_code"
      +  ],
      +  "title": "AgentResult",
      +  "type": "object"
      +}
  4. Addedv0.5.1

TDQS

B3.3/5.0
Behavior3/5

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

Annotations declare readOnlyHint=false and destructiveHint=false, a non-obvious combination (it produces output rather than modifying the page), and the description partly reconciles this by stating it returns a diff image and path. It adds the valuable epistemic caveat about interpreting differences, but omits threshold behavior and whether a file is written where 'name' points.

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?

Two short sentences, front-loaded with the action and followed by the return value plus a meaningful caveat. Nothing is wasted or repeated from the schema.

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?

An output schema exists, so return values need not be spelled out, and the description does mention the image and path anyway. The real remaining gap is parameter behavior (threshold, name, input format) for a 4-parameter tool with no schema descriptions.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0% across four parameters. The phrase 'two screenshots' loosely implies before/after, but it never says whether they are file paths, URLs, or session references, and the 'threshold' and 'name' parameters are completely unaddressed — threshold semantics matter a lot for a diff tool.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description names a specific verb ('Highlight changed regions') and resource ('between two screenshots'), which is enough to tell it apart from the plain screenshot tool. It stops short of explicitly naming the nearest alternative, regression_check, or stating how the two differ.

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 only implied by the phrase 'between two screenshots.' The closing caution ('a visual difference is a lead, not a verdict') gives useful interpretive guidance about what a positive result means, but no condition says when to prefer this over regression_check or verify_persistence.

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