Skip to main content
Glama

Extract color palette

extract_palette
Read-onlyIdempotent

Extract a dominant color palette from a local image using k-means clustering and return hex/RGB colors with coverage percentages.

Instructions

Extract the dominant color palette from a local image using k-means clustering. Returns hex/RGB colors with coverage percentages; transparent pixels are ignored.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "image": "<image>"
    },
    "name": "extract_palette"
  }
}

Input Schema

NameRequiredDescriptionDefault
imageYesAbsolute path to a local image on the machine running this MCP server.
color_countNoNumber of palette colors to extract (2-32). Defaults to 8.

Output Schema

NameRequiredDescriptionDefault
colorsYes
sourceYes
detailsNo
operationYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.0.1

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already cover safety (readOnly, idempotent, non-destructive, closed-world), so the bar is lower; the description nonetheless adds real behavior: hex/RGB output with coverage percentages and the rule that transparent pixels are ignored. Minor gap: it does not note that k-means results may vary slightly run to run despite idempotentHint, nor any cost on large images.

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?

Two tightly packed sentences, front-loaded with the primary action and method, then the output contract. No filler or repetition of the tool name.

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?

An output schema exists, so the return-value explanation is a bonus rather than a necessity, and both parameters are described in-schema. What is missing is small but real: supported image formats and behavior on an unreadable or missing file path.

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 both the absolute path requirement and the 2-32 color_count range with default 8 are already fully documented. The description adds no meaning beyond the schema, which is the expected baseline here.

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?

States a specific verb and resource ('Extract the dominant color palette from a local image') and adds the method ('k-means clustering'), which goes beyond the name/title. The 'local image' qualifier implicitly separates it from the generate/convert/HTML-render sibling tools, though no sibling is named explicitly.

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 only implied: 'from a local image' tells the agent this is not for remote URLs or image generation, but there is no explicit when-to-use, when-not-to-use, or pointer toward alternatives such as get_image_info or remove_background. An agent must infer the fit from the tool name alone.

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