Skip to main content
Glama
ext-sakamoro

Aseprite MCP Tools

by ext-sakamoro

batch_export

Export multiple Aseprite files to different formats like PNG, GIF, or JPG in a single operation, converting pixel art projects for sharing or further use.

Instructions

Batch export multiple Aseprite files to another format.

Args: input_dir: Directory containing input files output_dir: Directory for exported files format: Export format (png, gif, jpg, etc.) scale: Export scale factor file_pattern: File pattern to match (default: "*.aseprite")

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
input_dirYes
output_dirYes
formatNopng
scaleNo
file_patternNo*.aseprite

Implementation Reference

  • The batch_export tool implementation and its handler logic.
    @mcp.tool()
    async def batch_export(
        input_dir: str,
        output_dir: str,
        format: str = "png",
        scale: float = 1.0,
        file_pattern: str = "*.aseprite"
    ) -> str:
        """Batch export multiple Aseprite files to another format.
    
        Args:
            input_dir: Directory containing input files
            output_dir: Directory for exported files
            format: Export format (png, gif, jpg, etc.)
            scale: Export scale factor
            file_pattern: File pattern to match (default: "*.aseprite")
        """
        try:
            # Validate inputs
            input_path = validate_file_path(input_dir, must_exist=True)
            output_path = validate_file_path(output_dir, must_exist=True)
            format = validate_export_format(format)
            
            if not input_path.is_dir():
                raise ValidationError("input_dir", str(input_path), "Must be a directory")
            if not output_path.is_dir():
                raise ValidationError("output_dir", str(output_path), "Must be a directory")
            
            # Find all matching files
            files = list(input_path.glob(file_pattern))
            if not files:
                return f"No files matching '{file_pattern}' found in {input_path}"
            
            # Batch process each file
            processor = BatchProcessor()
            
            async def progress_callback(completed, total, current_file):
                print(f"Progress: {completed}/{total} - Processing {current_file}")
            
            # Define export operation
            def export_file(file_path: str, output_format: str, export_scale: float) -> str:
                output_file = Path(output_path) / Path(file_path).with_suffix(f".{output_format}").name
                
                cmd = get_command()
                args = ["--batch", file_path]
                
                if export_scale != 1.0:
                    args.extend(["--scale", str(export_scale)])
                
                args.extend(["--save-as", str(output_file)])
                
                success, output = cmd.run_command(args)
                return f"Exported to {output_file}"
            
            # Process files
            results = await processor.process_files(
                [str(f) for f in files],
                export_file,
                {"output_format": format, "export_scale": scale},
                progress_callback
            )
            
            # Summary
            summary = f"Batch export completed:\n"
            summary += f"- Total files: {results['total']}\n"
            summary += f"- Exported: {results['completed']}\n"
            summary += f"- Failed: {results['failed']}\n"
            summary += f"- Output directory: {output_path}"
            
            if results['errors']:
                summary += f"\n\nErrors:\n"
                for error in results['errors'][:5]:
                    summary += f"- {error['file']}: {error['error']}\n"
                if len(results['errors']) > 5:
                    summary += f"... and {len(results['errors']) - 5} more errors"
            
            return summary
            
        except (ValidationError, AsepriteError) as e:
            return f"Failed to batch export: {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. It states the tool exports files but doesn't describe what happens during export (e.g., overwrites existing files, creates output directories, handles errors, or requires specific permissions). For a tool that modifies filesystem content (export implies writing files), this lack of detail on side effects, safety, or performance is a significant gap.

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

Conciseness5/5

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

The description is well-structured and front-loaded: the first sentence states the core purpose, followed by a bulleted list of parameters with concise explanations. Every sentence earns its place, with no redundant or vague language. The two-part structure (overview + parameter details) is efficient and easy to parse.

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 complexity (a batch file-processing tool with 5 parameters), lack of annotations, and no output schema, the description is partially complete. It covers the purpose and parameters well but misses behavioral details (e.g., file overwriting, error handling) and output information. For a tool that performs filesystem operations, this leaves gaps an agent would need to infer or test.

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 adds meaningful context for all 5 parameters in the 'Args' section, explaining each parameter's purpose (e.g., 'input_dir: Directory containing input files'). This goes beyond the schema's minimal titles (e.g., 'Input Dir') and default values, providing clear semantics. However, it doesn't specify allowed values for 'format' beyond examples or constraints for 'scale' and 'file_pattern'.

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: 'Batch export multiple Aseprite files to another format.' It specifies the verb ('export'), resource ('Aseprite files'), and scope ('multiple'/'batch'), which is specific and actionable. However, it doesn't explicitly distinguish this batch export tool from sibling tools like 'export_sprite' or 'export_layers', which likely handle single exports or different export scopes.

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 sibling tools like 'export_sprite' (likely for single files) or 'batch_process_custom' (possibly for other batch operations), nor does it specify prerequisites, constraints, or typical use cases. The only implied usage is for batch exporting, but this is redundant with the purpose statement.

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