Skip to main content
Glama

fill_area

Flood-fills the matching-color area around a seed pixel on a sprite layer, applying an exact RGBA color with tolerance and contiguous options.

Instructions

Flood-fill the area around (x, y) whose colour matches the seed pixel's.

Neighbours are the 4 pixels left, right, above and below. Only the layer itself is looked at (not the composited image); outside its cel the layer counts as transparent, so filling an empty area covers it up to the canvas edges. The seed must be on the canvas. Pixels get exactly the colour, without blending.

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>",
      "x": "<x>",
      "y": "<y>",
      "color": "<color>"
    },
    "name": "fill_area"
  }
}

Input Schema

NameRequiredDescriptionDefault
xYesSeed pixel x
yYesSeed pixel y
pathYesSprite file. Relative paths resolve against the server root.
colorYes'#RRGGBB', '#RRGGBBAA' or 'transparent'
frameNo1-based frame number
layerNoLayer name or 'group/child' path; empty = the bottom-most normal layer
toleranceNoLargest per-channel RGBA difference that matches
contiguousNofalse: replace every matching pixel of the layer's canvas
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.5/5.0
Behavior3/5

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

With no annotations, the description carries the full burden, and it does disclose real behavior: 4-connectivity, layer-only evaluation, transparent-outside-cel semantics, canvas-bounded seed, and no blending. It never states that the sprite file is mutated on disk, whether the change is reversible, or what happens on a failing seed, which is a notable gap for a write operation.

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 definition opens with the core action and then layers constraints in a sensible order, with no filler sentences. It is somewhat long at five sentences, but each one adds a distinct semantic fact rather than restating the schema.

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?

For a 9-parameter mutating tool with no annotations, the description covers the tricky parts an agent would otherwise get wrong (connectivity, layer vs composite, cel boundaries, exact colour). An output schema exists so return values need not be explained; the only real omission is the mutation/persistence caveat.

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 coverage is 100%, so every parameter including tolerance, contiguous, create_cel and layer is already documented. The description adds some meaning to x/y by framing them as the seed and clarifies color application as exact substitution, but says nothing extra about tolerance or contiguous beyond the schema. Baseline 3 applies when the schema does the heavy lifting.

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?

"Flood-fill the area around (x, y) whose colour matches the seed pixel's" gives a specific verb plus a precisely bounded region, which is enough to distinguish it from drawing primitives and from fill_pattern. It stops short of naming any sibling or contrasting with the pattern-fill variant, so differentiation is inferential 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 mechanics: the seed must be on the canvas, and only the layer is examined rather than the composite. There is no explicit when-to-use/when-not statement and no pointer to fill_pattern for pattern-based fills, leaving the agent to infer the choice.

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