Skip to main content
Glama
ext-sakamoro

Aseprite MCP Tools

by ext-sakamoro

get_palette_info

Retrieve palette details from an Aseprite file to analyze color information for pixel art projects.

Instructions

Get information about the current palette in an Aseprite file.

Args: filename: Name of the Aseprite file to inspect

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filenameYes

Implementation Reference

  • The get_palette_info tool handler implemented in palette.py. It uses a LuaBuilder to construct a script that queries the Aseprite API for palette information and executes it.
    @mcp.tool()
    async def get_palette_info(filename: str) -> str:
        """Get information about the current palette in an Aseprite file.
    
        Args:
            filename: Name of the Aseprite file to inspect
        """
        try:
            # Validate inputs
            file_path = validate_file_path(filename, must_exist=True)
            
            # Build Lua script
            builder = LuaBuilder()
            builder.open_sprite(str(file_path))
            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()
            
            # Get palette info
            builder.add_line('local palette = spr.palettes[1]')
            builder.if_condition('not palette')
            builder.add_line('print("No palette found")')
            builder.add_line('return')
            builder.end_if()
            builder.add_line()
            
            builder.add_line('print("Palette information:")')
            builder.add_line('print("Number of colors: " .. #palette)')
            builder.add_line('print("\\nColors (index: hex):")')
            builder.for_loop('i', 0, 'math.min(#palette - 1, 255)')
            builder.add_line('local color = palette:getColor(i)')
            builder.add_line('print(string.format("%3d: #%02X%02X%02X", i, color.r, color.g, color.b))')
            builder.end_loop()
            
            # Execute script
            cmd = get_command()
            success, output = cmd.execute_lua_script(builder.build())
            
            if success and output:
                return f"Palette information for {file_path}:\n{output}"
            else:
                return f"No palette information found for {file_path}"
            
        except (ValidationError, AsepriteError) as e:
            return f"Failed to get palette info: {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?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool inspects a file but doesn't mention whether it's read-only, what happens if the file doesn't exist, error handling, or output format. This leaves critical behavioral traits unspecified for a tool that interacts with 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 appropriately sized and front-loaded, with the core purpose stated first in a clear sentence. The Args section is structured but could be more integrated; overall, it's efficient with minimal waste, though slight improvements in flow are possible.

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?

Given the complexity of file inspection, lack of annotations, and no output schema, the description is incomplete. It doesn't explain what information is returned (e.g., palette colors, size), error conditions, or dependencies, making it inadequate for an agent to use the tool effectively without guesswork.

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?

The description adds basic semantics for the single parameter ('filename: Name of the Aseprite file to inspect'), which is helpful since schema description coverage is 0%. However, it doesn't provide details like file format requirements, path handling, or examples, limiting its value beyond the bare minimum.

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 with a specific verb ('Get information') and resource ('current palette in an Aseprite file'), making it easy to understand what it does. However, it doesn't explicitly differentiate from sibling tools like 'extract_palette_from_image' or 'apply_preset_palette', which prevents a perfect score.

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 comparisons to siblings like 'extract_palette_from_image' for different palette-related tasks, leaving the agent with insufficient context for optimal selection.

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