Skip to main content
Glama

get_color_stats

Read-only

Analyze a sprite frame to list ranked RGBA color frequencies, counts, and percentage coverage, treating fully transparent pixels separately.

Instructions

The most used colours of the visible composite of one frame.

Colours are told apart by their full RGBA, so the same RGB at another alpha is a separate entry. Fully transparent pixels are only counted in transparent; unique and percent cover the other pixels; percent has 4 decimals. Ties are ordered by red, green, blue, then alpha. A frame with more than 1048576 different colours is refused (use extract_palette for such images).

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": "get_color_stats"
  }
}

Input Schema

NameRequiredDescriptionDefault
topNoMost colours to list
pathYesSprite file. Relative paths resolve against the server root.
frameNo1-based frame number

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.1/5.0
Behavior5/5

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

Beyond readOnlyHint=true, the description discloses the counting model in detail: colours are keyed on full RGBA so identical RGB at different alpha is a separate entry, fully transparent pixels count only in 'transparent' while 'unique' and 'percent' cover the rest, percent has 4 decimals, and ties break by red, green, blue, then alpha. It also states a hard refusal threshold and the fallback tool. This is genuinely useful behavior an agent could not infer from annotations.

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?

The lead sentence front-loads what the tool returns and the scope, and every following sentence carries a concrete rule (alpha separation, transparent handling, decimal precision, tie ordering, size limit). The middle sentences are dense and slightly run-on, but no statement is filler.

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?

The tool is a read-only stat extractor with an output schema, so return shape need not be re-explained, and the description still clarifies the semantics of the key output fields (transparent, unique, percent). Between the RGBA counting rules, tie-breaking, precision, and the size limit with fallback, an agent has everything needed to call it and interpret results.

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 'top', 'path' and 'frame' are already documented, and the description adds only indirect meaning ('most used colours' for top, 'visible composite of one frame' for frame). With the schema doing the heavy lifting, the baseline of 3 applies; no syntax or format detail is added for the parameters themselves.

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?

The description names the resource precisely: the most-used colours of the visible composite of a single frame, with RGBA-level granularity. An agent can distinguish this from extract_palette, which is explicitly named as the tool for images exceeding the colour limit. It stops short of a clean verb-first statement (the verb 'get' only appears in the name), so 4 rather than 5.

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?

It gives an explicit routing rule: a frame with more than 1048576 different colours is refused, and extract_palette should be used for such images. That is a concrete when-to-use-otherwise condition tied to a real constraint. It does not cover other selection contexts (e.g. when to prefer get_palette or get_palette-related tools), so it falls short of full when/when-not coverage.

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