Skip to main content
Glama

Extract a K-color palette from a TOP

extract_palette
Read-only

Extract dominant colors from any TOP preview using k-means clustering, returning a sorted palette for AI grading, palettes, and design hand-offs.

Instructions

Sample dominant colors from a TOP by capturing its preview PNG and running deterministic k-means on the decoded RGB pixels. Returns {source_top, k, width, height, pixels_sampled, hex_colors[], swatches[{hex,rgb,weight}], warnings[]} sorted by dominance (most-frequent cluster first). Feeds AI grading prompts, create_palette, and design hand-offs. Read-only; no nodes are created or modified.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
kNoNumber of palette colors to extract (2..16).
widthNoWidth to render the preview at before sampling (smaller is faster).
heightNoHeight to render the preview at before sampling.
source_topYesPath of the TOP to sample colors from.
Behavior4/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false, and the description reinforces this with 'Read-only; no nodes are created or modified.' It adds useful behavioral details like the deterministic nature of k-means and the sorting by dominance, which go beyond the annotations without contradicting them.

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 concise (three sentences), front-loaded with the core action, and efficiently packs method, return format, and use cases without unnecessary filler. Every sentence contributes meaningful information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Despite no output schema, the description fully specifies the return object structure and sorting order, making the tool's behavior and outputs clear. The read-only nature is stated, and the use cases provide sufficient context for an agent to decide when to invoke it.

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?

Schema covers all parameters at 100%, but the description adds value by explaining the rendering process (e.g., 'smaller is faster' for width/height) and how the parameters relate to the output (k colors, dimensions). This exceeds the baseline of 3 for full schema coverage.

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 samples dominant colors from a TOP using a specific method (capturing preview PNG and running deterministic k-means). It distinguishes itself from siblings like create_palette and get_preview by focusing on extraction from an existing TOP.

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?

The description mentions concrete use cases ('Feeds AI grading prompts, create_palette, and design hand-offs'), giving clear context for when to use it. It does not explicitly contrast with alternatives or say when not to use it, but the intended usage is well implied.

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/lucasmaher-hash/touch-designer-mcp'

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