Skip to main content
Glama
ext-sakamoro

Aseprite MCP Tools

by ext-sakamoro

draw_pixels

Modify Aseprite files by drawing individual pixels with specific colors using hex codes, enabling precise pixel art creation and editing.

Instructions

Draw pixels on the canvas with specified colors.

Args: filename: Name of the Aseprite file to modify pixels: List of pixel data, each containing: {"x": int, "y": int, "color": str} where color is a hex code like "#FF0000"

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filenameYes
pixelsYes

Implementation Reference

  • The `draw_pixels` handler function, which validates inputs, builds a Lua script using `LuaBuilder`, and executes it on an Aseprite file.
    @mcp.tool()
    async def draw_pixels(filename: str, pixels: List[Dict[str, Any]]) -> str:
        """Draw pixels on the canvas with specified colors.
    
        Args:
            filename: Name of the Aseprite file to modify
            pixels: List of pixel data, each containing:
                {"x": int, "y": int, "color": str}
                where color is a hex code like "#FF0000"
        """
        try:
            # Validate inputs
            file_path = validate_file_path(filename, must_exist=True)
            
            if not pixels:
                raise ValidationError("pixels", pixels, "Pixel list cannot be empty")
            
            # 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.add_line('local cel = app.activeCel')
            builder.if_condition('not cel')
            builder.add_comment('If no active cel, create one')
            builder.add_line('app.activeLayer = spr.layers[1]')
            builder.add_line('app.activeFrame = spr.frames[1]')
            builder.add_line('cel = app.activeCel')
            builder.if_condition('not cel')
            builder.add_line('error("No active cel and couldn\'t create one")')
            builder.end_if()
            builder.end_if()
            builder.add_line()
            
            # Use the efficient batch pixel drawing
            builder.draw_pixels(pixels)
            builder.end_transaction()
            builder.save_sprite()
            
            # Execute script
            cmd = get_command()
            success, output = cmd.execute_lua_script(builder.build(), str(file_path))
            
            return f"Pixels drawn successfully in {file_path}"
            
        except (ValidationError, AsepriteError) as e:
            return f"Failed to draw pixels: {e}"
        except Exception as e:
            return f"Unexpected error: {e}"
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. While it states the tool modifies an Aseprite file, it doesn't clarify whether this is a destructive operation, what permissions are needed, or how errors are handled. The description adds minimal behavioral context beyond the basic action, leaving critical gaps for a mutation 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 appropriately sized and front-loaded, with the core purpose stated first. The parameter details are organized in a clear 'Args:' section. While efficient, the 'Args:' label is slightly redundant since parameters are already documented in the schema, but overall it avoids unnecessary verbosity.

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?

Given the tool's complexity (a mutation operation with 2 parameters), lack of annotations, and no output schema, the description is moderately complete. It covers the basic action and parameter semantics but misses behavioral details like error handling or side effects. For a tool that modifies files, more context on safety and outcomes would be beneficial.

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?

The description adds significant meaning beyond the input schema, which has 0% description coverage. It explains that 'filename' is the name of an Aseprite file to modify and details the structure of 'pixels' with x, y coordinates and hex color codes. This compensates well for the schema's lack of documentation, though it doesn't cover edge cases like invalid colors or file formats.

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 tool's purpose: 'Draw pixels on the canvas with specified colors.' This is a specific verb+resource combination that distinguishes it from siblings like draw_circle or draw_rectangle, which draw different shapes. However, it doesn't explicitly differentiate from fill_area, which might also modify pixel colors.

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 like needing an existing Aseprite file, nor does it compare to sibling tools like fill_area or draw_rectangle for different use cases. The only implied context is modifying a canvas, but this is insufficient for clear usage decisions.

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