Skip to main content
Glama

pixel_apply_palette

DestructiveIdempotent

Snap opaque pixels to the nearest color in a palette to enforce consistent game palette across sprites and clean up stray colors.

Instructions

Snap every opaque pixel to the nearest color in a given palette — enforce a consistent game palette across sprites or clean up stray colors.

Nearest match is by RGB distance; each pixel's alpha is preserved and fully transparent pixels are untouched. Returns JSON {"canvas", "palette_size", "pixels_changed"}; plus a rendered image when preview=true. On failure returns "Error: ...".

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
paramsYes
Behavior4/5

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

Discloses RGB distance matching, alpha preservation, transparent pixels untouched, and return format. Annotations already provide idempotent and destructive hints; description adds useful details about pixel handling and failure response.

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 sentences with no wasted words. Front-loads purpose, then details behavior and return value. Efficient and structured.

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 explains return format (JSON with fields and error case). Covers purpose, behavior, parameters, and return value comprehensively.

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?

Input schema provides descriptions for all parameters; description adds value by mentioning preview returns a rendered image. The description does not repeat schema details but complements them.

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?

Cleary states the tool snaps opaque pixels to nearest color in a palette, with specific verb 'snap' and resource 'every opaque pixel'. Distinguishes from siblings like pixel_replace_color and pixel_flood_fill by describing a unique use case: enforcing a consistent game palette.

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?

Implicitly indicates when to use (enforce consistent palette, clean up stray colors) without explicit exclusions or alternative tool names. Provides clear context of usage from the description.

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/light-vp/pixelart-mcp'

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