Skip to main content
Glama

extract_palette

Read-only

Extract up to a set number of representative colors from a sprite's visible layers and frames using Aseprite quantization, without altering the sprite or its palette. Use the result with set_palette.

Instructions

Find up to max_colors colours that best represent the visible sprite.

Uses Aseprite's colour quantization over all visible layers and frames. Its palettes hold a transparent entry, which is left out of the result but takes one of the 256 slots, so max_colors=256 gives at most 255 colours. The sprite and its palette are not changed: pass the result to set_palette to use it.

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": {
      "path": "<path>"
    },
    "name": "extract_palette"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYesSprite file. Relative paths resolve against the server root.
max_colorsNoMost colours to return, counting a transparent slot
with_alphaNoKeep semi-transparent colours apart instead of opaque

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.6/5.0
Behavior5/5

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

The readOnlyHint annotation only says it doesn't mutate; the description adds real substance on top: the sprite and palette are untouched, only visible layers and frames are sampled, and the hidden transparent slot consumes one of the 256 colours. That last detail prevents an off-by-one misuse of max_colors.

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?

Front-loaded with the core action, then the quantization scope, then the mutability and follow-up in one dense sentence. The transparent-slot aside is slightly long but earns its place by preventing a concrete error.

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?

An output schema exists, so return values needn't be described. The description still covers scope of sampling, non-mutation guarantees, and the natural next step, which is everything an agent needs to call this three-parameter tool correctly.

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%, so the baseline is 3, but the description adds meaning beyond the schema for max_colors by explaining the transparent slot accounting (256 yields at most 255 colours). with_alpha is left to the schema, which is fine given full 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?

States a specific verb and resource: find up to max_colors colours that best represent the visible sprite, and names the algorithm (Aseprite colour quantization over all visible layers and frames). This separates it from get_palette (reads an existing palette) and set_palette (applies one).

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?

Clear context for when to use it: you want a derived palette rather than the sprite's current one, and the result feeds set_palette. It stops short of explicitly distinguishing this from get_palette or quantize_to_palette, so the agent must infer the boundary from the verb.

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