Skip to main content
Glama

Compare two images

image_compare

Measure differences between two images using SSIM, RMSE, PSNR, pixel change metrics, and perceptual hash distance to verify image transformations or detect duplicates.

Instructions

Measure how different two images are: SSIM, RMSE, PSNR, mean and max pixel difference, the fraction of changed pixels, and perceptual-hash distance. Use it to verify a transform or to spot duplicate images.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlNoURL for the first image.
pathNoPath to the first image.
alignNoResize the second image to the first's dimensions before comparing.
base64_dataNoInline base64 for the first image.
diff_amplifyNoAmplify the diff visually.
compare_to_urlNoURL for the second image.
compare_to_pathNoPath to the second image.
change_thresholdNoPer-pixel difference counted as a change.
compare_to_base64NoInline base64 for the second image.
create_diff_imageNoAlso write a visual difference image (white where identical).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
okNo
inputNoSummary of the source image, when one was read.
notesNo
stepsNo
metricsNoOperation-specific measurements (e.g. comparison scores).
outputsNo
operationYesTool that produced this result.
sizeChangeNo
inlineImageIncludedNoTrue when an image block accompanies this result for vision-capable clients.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4/5.0
Behavior3/5

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

With no annotations provided, the description must convey behavioral traits. It mentions the metrics and the use case but does not disclose how images are sourced (e.g., loading from URLs/paths), any authentication or network requirements, or what happens without both images. It adds some value but misses key operational 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?

The description is two sentences with high information density. It front-loads the core metric list and immediately gives use cases, all in a compact form. No filler or redundancy; every phrase 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 (10 params, no required ones) and the presence of an output schema and full parameter schema coverage, the description covers the 'what' and 'why' but not operational details like how to specify images. It could be more complete with notes on default behavior or limitations, but it is mostly sufficient for an agent to select and call it.

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 explains all 10 parameters. The description does not add extra meaning beyond the schema (e.g., no clarification on 'align' or 'change_threshold'). It lists metric outputs, which is helpful, but does not enhance parameter understanding. Baseline 3 is appropriate.

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 a specific verb ('Measure') and resource ('two images'), and enumerates the exact metrics produced (SSIM, RMSE, PSNR, etc.). It also differentiates from siblings by focusing on comparison rather than transformation or manipulation, making it distinct from tools like image_resize or image_transform.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear use cases: verifying a transform or spotting duplicate images. It implies when to use this tool over siblings (e.g., not for resizing) but does not explicitly state when not to use it or name alternatives, like image_transform, for verification. This is adequate but not fully explicit.

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