Skip to main content
Glama

fill_area

Fill connected pixel areas with color using paint bucket functionality for pixel art projects.

Instructions

Fill a connected area with a color (paint bucket)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectIdYesProject identifier
layerIndexNoLayer index (default: 0)
frameIndexNoFrame index (default: 0)
xYesX coordinate to start fill
yYesY coordinate to start fill
colorYesFill color in hex format

Implementation Reference

  • The tool handler 'fillAreaTool' inside PiskelServer that interfaces with the business logic.
    private fillAreaTool(
      projectId: string,
      layerIndex: number,
      frameIndex: number,
      x: number,
      y: number,
      color: string
    ): object {
      const frame = this.getFrame(projectId, layerIndex, frameIndex);
      const count = fillArea(frame, x, y, color);
      return { success: true, pixelsFilled: count };
    }
  • The core business logic function 'fillArea' that performs the actual flood fill.
    export function fillArea(
      frame: Frame,
      x: number,
      y: number,
      color: number | string
    ): number {
      const filled = floodFill(frame, x, y, color);
      return filled.length;
    }
  • MCP tool registration for 'fill_area'.
    {
      name: 'fill_area',
      description: 'Fill a connected area with a color (paint bucket)',
      inputSchema: {
        type: 'object',
        properties: {
          projectId: {
            type: 'string',
            description: 'Project identifier',
          },
          layerIndex: {
            type: 'number',
            description: 'Layer index (default: 0)',
          },
          frameIndex: {
            type: 'number',
            description: 'Frame index (default: 0)',
          },
Behavior2/5

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

With no annotations provided, the description carries full burden but only states the basic action. It doesn't disclose behavioral traits like whether the fill is destructive (overwrites existing pixels), requires specific permissions, has rate limits, or what happens on success/failure. The 'paint bucket' metaphor hints at mutation but isn't explicit about consequences.

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?

The description is a single, efficient sentence with zero waste—every word ('fill', 'connected area', 'color', 'paint bucket') contributes to understanding the tool's purpose. It's appropriately sized and front-loaded with the core action.

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

Completeness3/5

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

For a mutation tool with no annotations and no output schema, the description is minimally adequate but lacks completeness. It covers the basic purpose but misses behavioral context (e.g., side effects, error conditions) and output expectations. Given the complexity of a fill operation with 6 parameters, more guidance would be helpful.

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 parameters are well-documented in the schema. The description adds no additional meaning beyond implying 'connected area' relates to x/y coordinates and color, but doesn't clarify fill boundaries, tolerance, or interaction with existing pixels. Baseline 3 is appropriate as the schema does the heavy lifting.

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 clearly states the specific action ('fill a connected area'), resource ('area'), and tool metaphor ('paint bucket'), distinguishing it from sibling drawing tools like draw_pixel, draw_line, or draw_rectangle which perform different operations. It precisely communicates the tool's function without ambiguity.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives like draw_pixels for manual coloring or clear_frame for erasing. It lacks context about prerequisites (e.g., needing an existing project/layer/frame) or exclusions, leaving the agent to infer usage from parameter names alone.

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/yafeiaa/piskel-mcp-server'

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