Skip to main content
Glama

fill_pattern

Fills a rectangle with a two-color ordered Bayer dither, controlling density and matrix size while clipping the pattern to the canvas for pixel-art shading.

Instructions

Fill rect with an ordered dither of two colours (clipped to the canvas).

A pixel gets color_b when the Bayer threshold (v + 0.5) / n^2 at its canvas position is below density, color_a otherwise: 0 is all color_a, 1 all color_b. The matrix is anchored at canvas (0, 0), so separate fills tile seamlessly; with bayer2 and density 0.5, color_b lands where x + y is even.

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>",
      "rect": "<rect>",
      "color_a": "<color_a>",
      "color_b": "<color_b>",
      "density": "<density>"
    },
    "name": "fill_pattern"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYesSprite file. Relative paths resolve against the server root.
rectYesCanvas rectangle to paint
blendNofalse: pixels get exactly this colour (transparent erases, except on a background layer, which ignores alpha); true: the colour is alpha-blended over what is there
frameNo1-based frame number
layerNoLayer name or 'group/child' path; empty = the bottom-most normal layer
matrixNoBayer matrix size of the patternbayer4
color_aYes'#RRGGBB', '#RRGGBBAA' or 'transparent'
color_bYes'#RRGGBB', '#RRGGBBAA' or 'transparent'
densityYesShare of pixels that get color_b
create_celNoAdd an empty cel when the layer has none in that frame

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior4/5

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

With no annotations supplied, the description carries the full burden and does substantial work: it discloses canvas clipping, the exact threshold rule, the anchor at canvas (0,0) and the resulting seamless tiling between adjacent fills, plus a concrete worked example. It does not discuss what happens to pre-existing pixel data beyond what the schema's 'blend' description covers, nor any permission or reversal considerations.

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 action, then a compact formula and a single illustrative example. Every clause earns its place, though the formula is dense enough that a reader may need a second pass.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

A 10-parameter mutation tool with an output schema and 100% schema description coverage — the description only needs to nail the pattern semantics, which it does, including clipping and tiling. Remaining gaps (layer/cel side effects, blend interaction on a background layer) are already handled by schema descriptions, so nothing critical is missing.

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 real meaning beyond it: it defines density operationally ('0 is all color_a, 1 all color_b' via the Bayer threshold) and explains that the matrix is anchored to canvas origin, which is the non-obvious semantic of the 'matrix' enum. That is genuine value over 'Share of pixels that get color_b'.

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 opening sentence gives a specific verb ('Fill') plus resource ('rect') and the distinguishing mechanism ('ordered dither of two colours'), which separates it from the solid-fill sibling fill_area and from draw_gradient. It stops short of naming an alternative tool, so sibling differentiation is implicit rather than stated.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is implied by the semantics: reach for this when you want a dithered two-colour pattern rather than a solid fill. There is no explicit when-to-use/when-not statement and no reference to fill_area, erase_region, or other paint siblings, so the agent must infer the choice from the words 'ordered dither'.

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