Skip to main content
Glama

Extract a K-color palette from a TOP

extract_palette
Read-only

Extract dominant colors from a TouchDesigner TOP by sampling its preview and applying k-means clustering. Returns hex colors, swatches with weights, and warnings — useful for AI grading, palette creation, 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
source_topYesPath of the TOP to sample colors from.
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.
Behavior4/5

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

Annotations already declare readOnlyHint=true; description adds algorithm details (k-means, PNG capture) and output structure. No contradiction. Provides good transparency beyond annotations.

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 well-structured sentences. First sentence states action and method; second lists return fields and use cases. No extraneous information, front-loaded with key info.

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?

Given 100% schema coverage and annotations, the description covers all aspects: what it does, how it works, what it returns, and when to use it. No missing 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?

Schema coverage is 100%, but description adds context: preview resolution parameters (width, height) are for sampling speed, and k is the number of colors. This adds meaning beyond schema.

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 a TOP using k-means, distinguishes from siblings like 'create_palette' and 'color_grade' by specifying its role in feeding AI grading and palette creation.

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?

Provides context for usage: feeds AI grading prompts, create_palette, and design hand-offs. Also notes read-only nature. However, does not explicitly state when to avoid use or directly compare to alternatives beyond mentioning create_palette.

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/Pantani/tdmcp'

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