Skip to main content
Glama

glass_diff

Diff the current GUI frame against a named baseline, returning change stats and the bounding box of altered pixels. Optionally include a cropped image of the changed region.

Instructions

Diff the current frame against a named baseline; returns change stats + bbox. Set include_image: true to also return the current frame cropped to the changed region (omitted when nothing changed).

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.
Behavior3/5

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

No annotations are provided, so the description must carry the burden. It discloses two behaviors: returns change stats + bbox, and include_image returns a cropped frame "omitted when nothing changed." However, it does not state whether the operation is read-only, how errors are handled, or how outputs change with parameters like `region` (e.g., bbox becomes region-relative). The schema provides some of this, but the description itself adds limited behavioral context.

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?

The description is two sentences, front-loads the core purpose, and contains no filler. The second sentence clarifies an optional parameter's effect. Every word adds value; it is appropriately sized and structured.

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?

The tool has 7 parameters and no output schema, yet the description only vaguely says "returns change stats + bbox" without enumerating the stats fields. It does not mention the `mode`, `threshold`, `region`, or `ignore` parameters, though the schema covers those. The description is adequate for a simple diff operation but incomplete for a tool with this many options and no return type specification.

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%, and each parameter has a detailed description in the schema. The tool description only adds a note about `include_image` ("Set include_image: true to also return the current frame cropped to the changed region") and otherwise does not enhance parameter understanding. This matches the baseline of 3 for high schema coverage.

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 clearly states the tool's function: "Diff the current frame against a named baseline; returns change stats + bbox." It names a specific verb (diff), resource (current frame vs. baseline), and output (change stats + bbox). This distinguishes it from sibling tools like glass_baseline_save (which saves a baseline) and glass_screenshot (which captures a frame).

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?

The description implies usage (compare the current frame to a previously saved baseline) but does not explicitly state when to use this tool versus alternatives, nor does it provide exclusions. Sibling tools like glass_wait_for_region are not mentioned in the description, though the schema references them. Guidance is implicit, not explicit.

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

Install Server

Other Tools

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