Skip to main content
Glama
ext-sakamoro

Aseprite MCP Tools

by ext-sakamoro

draw_rectangle

Add rectangles to Aseprite pixel art files by specifying position, dimensions, color, and fill options for precise canvas modifications.

Instructions

Draw a rectangle on the canvas.

Args: filename: Name of the Aseprite file to modify x: Top-left x coordinate y: Top-left y coordinate width: Width of the rectangle height: Height of the rectangle color: Hex color code (default: "#000000") fill: Whether to fill the rectangle (default: False)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filenameYes
xYes
yYes
widthYes
heightYes
colorNo#000000
fillNo

Implementation Reference

  • The draw_rectangle tool handler function in drawing.py. It validates inputs, constructs a Lua script using LuaBuilder, and executes it via Aseprite.
    async def draw_rectangle(filename: str, x: int, y: int, width: int, height: int, color: str = "#000000", fill: bool = False) -> str:
        """Draw a rectangle on the canvas.
    
        Args:
            filename: Name of the Aseprite file to modify
            x: Top-left x coordinate
            y: Top-left y coordinate
            width: Width of the rectangle
            height: Height of the rectangle
            color: Hex color code (default: "#000000")
            fill: Whether to fill the rectangle (default: False)
        """
        try:
            # Validate inputs
            file_path = validate_file_path(filename, must_exist=True)
            color = validate_color(color)
            
            if width < 1:
                raise ValidationError("width", width, "Width must be at least 1")
            if height < 1:
                raise ValidationError("height", height, "Height must be at least 1")
            
            # 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.draw_rectangle(x, y, width, height, color, fill)
            builder.end_transaction()
            builder.save_sprite()
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states the tool modifies an Aseprite file, implying mutation, but doesn't address permissions, whether changes are destructive/reversible, error conditions, or side effects. This is inadequate for a mutation tool with zero annotation coverage.

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 efficiently structured with a brief purpose statement followed by a parameter list. Every sentence adds value, and it's appropriately sized for the tool's complexity. Minor improvement could come from front-loading more critical context before the parameter details.

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 7 parameters, no annotations, and no output schema, the description is minimally adequate. It covers the basic purpose and parameters but lacks behavioral context, error handling, output expectations, and sibling differentiation. Completeness is borderline given the tool's complexity and missing structured data.

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%, so the description must compensate. It provides clear semantics for all 7 parameters, explaining what each represents (e.g., 'Top-left x coordinate', 'Hex color code') and noting defaults for 'color' and 'fill'. This adds significant value beyond the bare schema, though it could benefit from format details like coordinate systems.

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 ('Draw a rectangle') and target ('on the canvas'), specifying the exact operation. However, it doesn't explicitly differentiate from sibling tools like 'draw_circle' or 'draw_line' beyond the obvious shape difference, missing guidance on when to choose rectangle over other drawing tools.

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?

No guidance is provided on when to use this tool versus alternatives like 'draw_circle', 'draw_line', or 'fill_area'. The description lacks context about prerequisites (e.g., canvas must exist), typical use cases, or comparisons with sibling tools, leaving the agent without usage direction.

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