Skip to main content
Glama

Pull a website colour palette from an image

palette_extract

Extract dominant colours from an image as hex codes and coverage shares, plus a ready-to-use :root CSS custom-properties block. Use it to build a colour palette from any photo or banner.

Instructions

Reads the dominant colours out of a real image (a generated hero, banner or any photo) and returns them as hex codes with their share of the image, plus a ready :root CSS custom-properties block. This is a colour histogram, not a brand decision: it names the colours --palette-1, --palette-2 and so on by how much of the image they cover, most dominant first. Decide yourself which one is the primary, the accent or the background before wiring it into a stylesheet.

Input Schema

NameRequiredDescriptionDefault
countNo
input_pathYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.4.1

TDQS

A3.5/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, and it does disclose the output shape (hex codes, coverage shares, ordered --palette-1..N names, ready CSS block) and clarifies that ordering is by pixel coverage, not semantics. It says nothing about failure modes — invalid path, unsupported or missing image, very low-diversity images — which matters for a filesystem-reading tool.

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?

Three sentences, front-loaded with what it returns, followed by the naming convention and interpretive caveat. The closing 'decide yourself' sentence earns its place by preventing misuse, though it could be tightened.

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?

For a 2-param, no-annotation, no-output-schema tool, the description conveys the return structure well enough that an output schema is less necessary. But the undocumented `count` parameter and the absence of any error/format expectations leave real gaps an agent would hit on first call.

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

Parameters2/5

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

Schema description coverage is 0% and the description never mentions the `count` parameter, which controls how many colours are returned (1-12, default 6) and directly shapes the output. `input_path` is only obliquely implied by 'a real image'; the agent must infer it is a path to a local file rather than a URL or asset id.

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?

States a specific verb and resource: reads dominant colours from an image and returns hex codes with coverage shares plus a :root CSS block. The 'colour histogram, not a brand decision' framing clearly separates it from generative siblings like image_generate or brand_profiles.

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?

It names the input context ('a generated hero, banner or any photo') and tells the agent to interpret the output itself rather than treat it as a brand decision, which implies usage. However, it never states when to prefer this over alternatives (e.g. brand_profiles for existing brand colours) or what conditions make it inapplicable.

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