Skip to main content
Glama

glass_diff

Read-only

Compare current window pixels against a saved baseline to detect visual changes, returning change statistics and a bounding box for the affected region.

Instructions

Compare current visual evidence with a named pixel baseline; returns change stats and a bounding box. This is a single current-state comparison, not a wait for transition completion or stability; use glass_wait_for_region to wait for pixel change/match and glass_wait_stable for quiescence. Set include_image:true to return the changed crop when pixels differ.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modeNo`"perceptual"` (default) or `"exact"`.
nameYesName of a baseline saved by `glass_baseline_save`; an unsaved name errors rather than reporting no change.
ignoreNoWindow-relative rectangles to exclude from the comparison. Use for perpetually animating content — a blinking text caret, a clock, a spinner — which otherwise keeps `changed_pct` permanently non-zero. `changed_pct` is measured over the pixels that remain; the excluded count is reported as `ignored_pixels`. Combines with `region`: rects are always window-relative and are intersected with it.
regionNoOptional window-relative sub-rectangle to diff; omit to diff the whole window. Scopes the comparison (and the reported `bbox`, which becomes region-relative) to just this area — the way to ask "did *only* this part change?" Mirrors `glass_wait_for_region`'s `region`.
thresholdNoPerceptual sensitivity for `mode="perceptual"`, 0..1 (default 0.1; smaller = stricter).
toleranceNoPer-channel tolerance for `mode="exact"` (default 0).
include_imageNoAlso return the current frame cropped to the changed region (default false). No image is returned when nothing changed.

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Changed6 schema fields changedv1.2.0
    • addedInput schema / $defs / RegionArgs / properties / height / description
      Added value: +"Height in pixels, extending down from `y`."
    • addedInput schema / $defs / RegionArgs / properties / width / description
      Added value: +"Width in pixels, extending right from `x`."
    • addedInput schema / $defs / RegionArgs / properties / x / description
      Added value: +"Left edge in pixels, window-relative — 0 is the window's left edge, not the screen's."
    • addedInput schema / $defs / RegionArgs / properties / y / description
      Added value: +"Top edge in pixels, window-relative — 0 is the window's top edge, not the screen's."
    • addedInput schema / properties / name / description
      Added value: +"Name of a baseline saved by `glass_baseline_save`; an unsaved name errors\nrather than reporting no change."
    • removedInput schema / title
      Removed value: -"DiffArgs"
  2. Addedv1.1.0
  3. Removedv1.0.3
  4. Addedv1.0.2

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already mark the tool as read-only, and the description adds valuable behavioral context: this is a non-waiting, one-shot comparison, and include_image only returns a crop when pixels actually differ. This goes beyond what annotations alone convey, though it does not describe full return-structure details.

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 with no filler: the core action and outputs are front-loaded, the distinguishing usage guidance follows, and the optional include_image behavior closes efficiently. Every sentence earns its place.

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?

Given the tool's moderate complexity, full parameter schema coverage, and readOnly annotation, the description covers purpose, usage boundaries, and the key optional behavior. It does not detail the exact shape of 'change stats' or the bbox, but that is not required without an output schema and does not prevent correct invocation.

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 all seven parameters thoroughly. The description only reiterates include_image's effect without adding meaning beyond the schema, which keeps this at the baseline for fully-covered schemas.

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 uses a specific verb ('Compare'), names the resource ('current visual evidence with a named pixel baseline'), and states the outputs ('change stats and a bounding box'). It also explicitly distinguishes itself from wait-for tools, making its purpose unmistakable among siblings.

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 clearly states when to use this tool ('single current-state comparison') and when not to, naming the alternatives: 'glass_wait_for_region to wait for pixel change/match and glass_wait_stable for quiescence.' It also gives a concrete usage tip for include_image, so an agent knows how to get the changed crop.

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

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/fixed-width/glass'

If you have feedback or need assistance with the MCP directory API, please join our Discord server