Skip to main content
Glama

compare_images

Measure visual similarity between two images using mathematical feature extraction. Supports color, texture, and shape features like CEDD and JCD.

Instructions

Compare two images mathematically to get a similarity score.

This measures visual similarity based on mathematical features, NOT semantic content. Different subjects can be "similar" if they share color palettes, textures, or compositions.

Args: image_a: Path to first image image_b: Path to second image feature: Feature for comparison. Recommended: - "CEDD": Color + edge (144 dims, good general purpose) - "JCD": Joint CEDD+FCTH (168 dims, best for similarity) - "ColorHistogram": Color only (64 dims) - "LocalBinaryPatterns": Texture only (256 dims) - "PHOG": Shape only (630 dims) metric: Distance metric - "cosine", "euclidean", "l1"

Returns: Similarity score (0-100%) and interpretation.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
image_aYes
image_bYes
featureNoCEDD
metricNocosine

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

No annotations are provided, so the description carries full burden. It discloses that the tool returns a similarity score (0-100%) and interpretation, and explains that similarity is based on mathematical features like color, texture, shape. It does not mention potential side effects, but the operation appears read-only.

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?

Description is concise and well-structured with an introductory sentence followed by an Args list. Every sentence adds value, no fluff, and it is front-loaded with the core purpose.

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 has an output schema, the description does not need to explain return values in detail. It covers main aspects: purpose, parameters, and behavioral caveat. Minor gaps exist, such as not mentioning image format requirements or error handling for invalid paths.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It explains all four parameters: image_a, image_b are paths; feature includes recommended options with dimensions and use cases; metric lists distance options. This adds significant meaning beyond the schema.

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 it compares two images mathematically to get a similarity score, which is a specific verb+resource. It distinguishes from siblings like analyze_image and extract_features by emphasizing mathematical rather than semantic analysis.

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?

Provides explicit context that the tool measures visual similarity based on mathematical features, not semantic content. Recommends specific features for different purposes (e.g., 'CEDD' for general purpose, 'JCD' for best similarity). However, it does not explicitly state when not to use this tool or suggest alternatives among siblings.

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/kelkalot/imagefeatures-mcp'

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