Skip to main content
Glama
ext-sakamoro

Aseprite MCP Tools

by ext-sakamoro

fill_area

Fill pixel art areas with color using paint bucket functionality. Specify coordinates and color to modify Aseprite files programmatically.

Instructions

Fill an area with color using the paint bucket tool.

Args: filename: Name of the Aseprite file to modify x: X coordinate to fill from y: Y coordinate to fill from color: Hex color code (default: "#000000") tolerance: Tolerance for color matching (0-255, default: 0)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filenameYes
xYes
yYes
colorNo#000000
toleranceNo

Implementation Reference

  • The MCP tool handler function 'fill_area' which validates inputs, builds a Lua script for Aseprite, and executes it.
    @mcp.tool()
    async def fill_area(filename: str, x: int, y: int, color: str = "#000000", tolerance: int = 0) -> str:
        """Fill an area with color using the paint bucket tool.
    
        Args:
            filename: Name of the Aseprite file to modify
            x: X coordinate to fill from
            y: Y coordinate to fill from
            color: Hex color code (default: "#000000")
            tolerance: Tolerance for color matching (0-255, default: 0)
        """
        try:
            # Validate inputs
            file_path = validate_file_path(filename, must_exist=True)
            color = validate_color(color)
            
            if tolerance < 0 or tolerance > 255:
                raise ValidationError("tolerance", tolerance, "Tolerance must be between 0 and 255")
            
            # Build Lua script
            builder = LuaBuilder()
            builder.add_line('local spr = app.activeSprite')
            builder.if_condition('not spr')
            builder.add_line('error("No active sprite")')
            builder.end_if()
            builder.add_line()
            
            builder.begin_transaction()
            builder.fill_area(x, y, color, tolerance)
            builder.end_transaction()
            builder.save_sprite()
            
            # Execute script
            cmd = get_command()
            success, output = cmd.execute_lua_script(builder.build(), str(file_path))
  • The 'LuaBuilder' method 'fill_area' that generates the specific Lua script lines for the Aseprite paint bucket tool.
    def fill_area(self, x: int, y: int, color: str, tolerance: int = 0) -> 'LuaBuilder':
        """Fill an area with color (paint bucket)."""
        self.set_color(color)
        
        self.add_line('app.useTool{')
        self.indent()
        self.add_line('tool="paint_bucket",')
        self.add_line(f'points={{{{x={x}, y={y}}}}},')
        self.add_line(f'tolerance={tolerance}')
        self.dedent()
        self.add_line('}')
        return self
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 offers minimal behavioral insight. It implies a mutation ('modify') but doesn't disclose side effects (e.g., overwriting existing pixels, layer selection), error conditions, or output format. The mention of 'tolerance' hints at color matching behavior, but overall transparency is inadequate for a tool with destructive potential.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with the core purpose, followed by a structured Args list. However, the Args section is somewhat redundant as it repeats schema information without adding high-value insights (e.g., explaining coordinate systems or tolerance effects). It's efficient but could be more streamlined by integrating parameter details into the narrative.

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

Completeness2/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 incomplete. It lacks critical details: what happens on success/failure, whether changes are undoable, how it interacts with layers or frames, and what the return value is. The parameter explanations help, but overall context is insufficient for safe and effective use.

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 description coverage is 0%, but the description compensates well by explaining all 5 parameters in the Args section. It clarifies that 'filename' is for an Aseprite file, 'x' and 'y' are coordinates to fill from, 'color' is a hex code with a default, and 'tolerance' defines a 0-255 range for color matching. This adds meaningful context beyond the bare schema.

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 description clearly states the action ('fill an area with color') and the mechanism ('using the paint bucket tool'), which distinguishes it from other drawing tools like draw_circle or draw_rectangle. However, it doesn't explicitly differentiate from potential color manipulation siblings like remap_colors or apply_preset_palette, keeping it at a 4 rather than a 5.

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. It doesn't mention prerequisites (e.g., needing an existing Aseprite file), compare to other drawing tools, or specify use cases like filling bounded regions versus general coloring. This lack of contextual direction limits its utility for an AI agent.

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/ext-sakamoro/AsepriteMCP'

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