Skip to main content
Glama

get_dominant_colors

Extract the dominant colors from an image using K-means clustering. Returns exact hex codes and percentages for each color.

Instructions

Extract the dominant colors from an image.

Uses K-means clustering to find the most prominent colors. Returns exact hex codes and percentages.

Args: image_path: Path to the image num_colors: Number of colors to return (1-5)

Returns: List of hex codes with percentages.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
image_pathYes
num_colorsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior3/5

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

The description discloses the method (K-means) and outputs (hex codes with percentages), but lacks details on potential limitations, error handling, or prerequisites like file existence. Without annotations, the description carries the full burden, and while functional, it misses behaviors like image size impact.

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 succinct with three sentences plus an Args/Returns block. Every sentence adds value, and the structure is front-loaded with the main action. No wasted words.

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 low complexity (2 parameters, 1 required) and the presence of an output schema, the description is adequate. It covers the core functionality and parameter semantics, though it could briefly mention relation to sibling tools for more context.

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

Parameters4/5

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

With 0% schema description coverage, the description compensates by clearly explaining each parameter's purpose and adding a range constraint for num_colors (1-5) not present in the schema. This provides meaningful guidance beyond the raw schema types.

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 extracts dominant colors from an image using K-means clustering, specifying the output as hex codes and percentages. This is a specific verb-resource combination that distinguishes it from siblings like check_image_quality or compare_images.

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 for color extraction but does not provide explicit guidance on when to choose this tool over siblings, such as analyze_image or extract_features. No when-not-to-use or alternatives are mentioned.

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