Skip to main content
Glama

compare_images

Compare two open PixInsight views pixel by pixel to measure per-channel max, mean, and 99th-percentile absolute differences, plus out-of-range fractions. Neither view is altered.

Instructions

Compare two open views of the same width, height and channel count, pixel by pixel, over the whole image or a rectangle. Per channel: maximum, mean and 99th-percentile absolute difference, and the fraction of samples outside [0, 1] in each view. "identical" is true when every absolute difference is 0. The 99th percentile is taken over at most 2,000,000 evenly spaced samples (p99Samples says how many); maximum and mean use every sample. Neither view is changed.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
rectNoOptional region [x0, y0, x1, y1] in pixels, x1/y1 exclusive
view_idYesFirst view (A)
reference_idYesSecond view (B), compared against A

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv2.4.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 that neither view is mutated, that maximum and mean use every sample while p99 is taken over at most 2,000,000 evenly spaced samples, and defines when "identical" is true. It omits any note on error behavior for mismatched views, keeping it short of a 5.

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

Conciseness4/5

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

Front-loaded with the core action, then the metrics, then the sampling caveat and the non-mutation guarantee in a single efficient closing sentence. Dense but every clause carries information; the nested quantifier/percentile detail is a touch heavy but justified.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

There is no output schema, so the description must explain return values — and it enumerates them: per-channel max, mean, 99th-percentile absolute difference, fraction outside [0, 1], the "identical" flag, and p99Samples. An agent knows exactly what it will get back.

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 view_id, reference_id, and rect (including exclusive x1/y1). The description restates the whole-image-vs-rectangle choice and defines A/B roles implicitly, adding only marginal meaning beyond the schema — the baseline 3.

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?

States a precise verb and resource — pixel-by-pixel comparison of two open views — plus the dimensional precondition (same width, height, channel count). This clearly distinguishes it from siblings like get_image_stats or measure_sharpness, which operate on a single view.

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 conveys the applicable context (two open views of matching geometry, whole image or a rect) but never explicitly says when to pick this tool over alternatives or what to do if the views differ in size. Usage is implied rather than stated, so it lands at minimum-viable.

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