Skip to main content
Glama

canon_learn

Define or update named sprite regions by sampling colors from image points, with optional protection, so repaint stays consistent and verification checks integrity.

Instructions

Define or update a named region in the canon (e.g. skin, hair, outfit, outline). Give a few [x,y] points on sample images; the sampled colours (optionally expanded by absorb) become the region. The region's luminance range is recorded — repaint uses that FIXED range so the same source colour always maps to the same output colour in every frame and direction. Mark regions like face/eyes/outline as protected: repaint will never touch them and verify will fail if anything else does. Instead of points you may pass explicit colors, or an HSL rule (hue/sat/light ranges) for anti-aliased art — an HSL-only region additionally needs lumRange if you ever want to repaint it. Updates MERGE additively into an existing region; pass replace=true to redefine it from scratch (the only way to remove a mis-sampled colour).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
hueNoHSL rule: hue range in degrees
satNoHSL rule: saturation range 0..1
cellHNospritesheet cell height (PNG sheets only)
cellWNospritesheet cell width (PNG sheets only)
lightNoHSL rule: lightness range 0..1
absorbNoalso absorb colours within this per-channel distance of sampled ones (default 0)
colorsNoexplicit hex colours instead of samples
regionYesregion name, e.g. 'skin' / 'outline' / 'cloak'
replaceNoredefine the region from scratch instead of merging (default false)
samplesNo
lumRangeNofixed luminance range (0-255) for repainting — required for HSL-only regions, auto-computed for colour lists
canonPathNopath to sprite-canon.json (default: search upward from the target file)
protectedNomark as protected (never repainted, verified untouched)
Behavior5/5

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

With no annotations provided, the description carries the full burden, and it does so thoroughly. It explains the fixed luminance-range behavior for repaint, that protected regions are never repainted and cause verify to fail if touched, that updates merge additively, and that replace=true is required to remove mis-sampled colors. These are exactly the nontrivial behavioral facts an agent must know before calling the tool.

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 description is a single dense paragraph, but every sentence carries meaningful content: region definition, sampling, luminance range, protected regex, HSL rules, and replace/merge semantics. It is slightly unstructured, but the length is justified by the complexity of the tool's behaviors.

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 this tool's complexity (13 parameters; no annotations; no output schema to lean on), the description covers all the essential behavior safely and completely: how to define a region from colors, HSL, or points; how protection works; fixed luminance behavior; how update/merge works; and how to remove colors. Very little is left to an agent's guess.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 92%, so the baseline is 3, but the description adds significant meaning beyond the schema: it explains how sampled colors expand via `absorb`, how HSL rules need `lumRange` for repainting, what `protected` means, and how `replace=true` differs from the default merge. This goes beyond the bare property descriptions to explain how parameters relates to one another.

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 opens with a clear verb+resource: 'Define or update a named region in the canon,' and gives concrete examples (skin, hair, outfit, outline). It is easily distinguished from sibling tools like sprite_repaint or sprite_verify, since it is about defining regions rather than painting or verifying them.

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 gives clear context for when to use the tool—defining or updating canon regions—and explains which sampling modes to use when (points, explicit colors, HSL rules). It does not explicitly name alternatives or state 'use X instead,' but the workflow interactions with repaint and verify are described, so an agent gets a solid sense of when this tool is relevant.

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/useka12-eng/sprite-canon'

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