Skip to main content
Glama

image_extract_colors

Extract dominant colors from images or video frames using K-means clustering, returning hex codes, RGB values, CSS color names, and coverage percentages for palette analysis.

Instructions

Extract dominant colors from an image or video frame.

Uses K-means clustering to find the most prominent colors. Returns hex codes, RGB values, CSS color names, and percentage coverage.

Args: image_path: Absolute path to the image or video file. If video, extracts a representative frame. n_colors: Number of dominant colors to extract (1-20, default 5).

Input Schema

NameRequiredDescriptionDefault
n_colorsNo
overwriteNoExplicitly allow replacing existing media. Existing non-media files are protected.
image_pathYes

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.16.4
    • addedInput schema / properties / overwrite
      Added value: +{
      +  "default": false,
      +  "description": "Explicitly allow replacing existing media. Existing non-media files are protected.",
      +  "title": "Overwrite",
      +  "type": "boolean"
      +}
  2. Changed1 schema field changedv1.16.0
    • addedInput schema / additionalProperties
      Added value: +false
  3. Addedv1.5.1

TDQS

B3.4/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 burden. It discloses the algorithm (K-means), the returned fields, and the video-frame behavior, which is solid. However, the presence of an `overwrite` parameter implies the tool may write or replace files, and the description never mentions any output artifact, side effect, or replacement semantics.

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?

The description is front-loaded with purpose and return shape, followed by a clean Args block. The K-means sentence is mildly redundant with "dominant colors" but it adds real methodological detail and costs little.

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?

An output schema exists, so the return-value listing is a bonus rather than a necessity, and the two extraction parameters are well covered. The gap is the write/overwrite behavior, which is not explained anywhere in prose and matters for a tool sitting alongside many file-producing siblings.

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 only 33% (only `overwrite` is documented in the schema), so the description must compensate. It does well for `image_path` (absolute path, video handling) and `n_colors` (range 1-20, default 5), but `overwrite` — the one parameter the schema does cover — is never mentioned, leaving the write/destructive semantics of this tool unaddressed.

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 description opens with a specific verb and resource: "Extract dominant colors from an image or video frame," and it names the algorithm and the return fields. It does not distinguish itself from the closest sibling, image_generate_palette, which an agent could easily confuse it with.

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?

Usage is implied by the purpose statement; no explicit when-to-use, when-not-to-use, or alternative is given. The note that a video input triggers representative-frame extraction is useful context but is behavioral, not routing guidance.

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

Deploy Server

Other Tools