Skip to main content
Glama
ext-sakamoro

Aseprite MCP Tools

by ext-sakamoro

add_frame

Add a new frame to an Aseprite file at a specified position to extend animation sequences or insert intermediate frames for pixel art workflows.

Instructions

Add a new frame to the Aseprite file.

Args: filename: Name of the Aseprite file to modify after_frame: Frame index after which to add the new frame (0-based, optional)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filenameYes
after_frameNo

Implementation Reference

  • The 'add_frame' tool handler that validates input, builds the script using 'LuaBuilder', and executes it.
    @mcp.tool()
    async def add_frame(filename: str, after_frame: Optional[int] = None) -> str:
        """Add a new frame to the Aseprite file.
    
        Args:
            filename: Name of the Aseprite file to modify
            after_frame: Frame index after which to add the new frame (0-based, optional)
        """
        try:
            # Validate inputs
            file_path = validate_file_path(filename, must_exist=True)
            
            # 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_frame(after_frame)
            builder.end_transaction()
            builder.save_sprite()
            
            # Execute script
            cmd = get_command()
            success, output = cmd.execute_lua_script(builder.build(), str(file_path))
            
            return f"New frame added successfully to {file_path}"
            
        except (ValidationError, AsepriteError) as e:
            return f"Failed to add frame: {e}"
        except Exception as e:
            return f"Unexpected error: {e}"
  • The helper method in 'LuaBuilder' that generates the actual Lua code for adding a frame to an Aseprite sprite.
    def add_frame(self, after_frame: Optional[int] = None) -> 'LuaBuilder':
        """Add a new frame to the sprite."""
        if after_frame is not None:
            self.add_line(f'app.activeSprite:newFrame({after_frame + 1})')  # Lua is 1-indexed
        else:
            self.add_line('app.activeSprite:newFrame()')
        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 permissions needed, whether changes are saved automatically, error conditions, or what happens if 'after_frame' is out of bounds. This leaves critical behavioral traits undocumented for a tool that modifies files.

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 front-loaded with the core purpose in the first sentence, followed by parameter explanations. It's appropriately sized with no redundant information, though the Args section could be integrated more smoothly rather than as a separate block.

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, no output schema, and 0% schema coverage, the description is incomplete. It lacks details on success/failure responses, side effects (e.g., file saving), and error handling, which are crucial for an agent to use this tool effectively in a workflow.

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 explains both parameters: 'filename' as the file to modify and 'after_frame' as an optional 0-based index for insertion position. This adds meaningful context beyond the bare schema, though it could detail file format expectations or default behavior when 'after_frame' is omitted.

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 ('Add a new frame') and target resource ('to the Aseprite file'), making the purpose immediately understandable. However, it doesn't differentiate this tool from its siblings like 'add_layer' or 'create_canvas', which would require mentioning it specifically handles frames rather than other file components.

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., file must exist), exclusions, or related tools like 'create_canvas' for starting a new file, leaving the agent to infer usage context independently.

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