Skip to main content
Glama
Fwmouomu
by Fwmouomu

assert_visual

Compare a screen region against a baseline PNG to detect visual changes and avoid whole-screen flakiness. Explicitly update the baseline when needed.

Instructions

Compare the current screen, or a region of it, against a baseline image.

Region comparison is the reason this is usable. A whole-screen baseline on a device with a clock in the status bar differs on every single run, which is how visual testing earns its reputation for flakiness. Cropping to the part that matters is what makes the result mean something.

update_baseline exists so refreshing a baseline is an explicit, visible act rather than an edit someone makes by hand and forgets to review.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
deviceNoDevice serial. Omit to take any single free device.
regionNo[left, top, right, bottom] in pixels to compare. Omit to compare the whole screen.
baselineYesPath to the baseline PNG to compare against.
toleranceNoFraction of differing pixels still considered a match.
update_baselineNoOverwrite the baseline with the current screen and pass.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.3/5.0
Behavior3/5

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

With no annotations, the description carries the full behavioral burden. It adds useful context about flakiness and the explicit baseline-refresh intent, but says nothing about what happens when the comparison fails (exception vs. returned diff), whether it blocks, or what permissions/environment it requires.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Purpose is correctly front-loaded in sentence one and nothing is buried. The middle paragraph drifts into rhetorical justification ('how visual testing earns its reputation for flakiness') rather than information the agent needs to call the tool.

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?

For a 5-parameter assertion tool with no annotations and no output schema, the definition covers purpose and region rationale but omits the failure contract — the single most important thing an agent needs when invoking an assertion. Adequate but with a clear gap.

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 100%, so device, region, baseline, tolerance and update_baseline are already documented in the schema. The description reinforces why region matters and clarifies the intent of update_baseline, but adds no format, range or interaction detail beyond the schema, so baseline 3 applies.

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 opening sentence gives a specific verb (compare) and resource (current screen or region) against a baseline image, so the operation is unambiguous. It does not, however, distinguish itself from the sibling run_and_assert, which an agent could plausibly reach for on the same task.

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?

It explains why region cropping is preferable to whole-screen comparison, which is real usage guidance for the region parameter, and it frames update_baseline as the deliberate refresh path. It never says when to call this tool versus run_and_assert or the record/explore siblings, so routing is left to inference.

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