Skip to main content
Glama

run_lua_script

Run custom Lua scripts in Aseprite for any unsupported action, with the option to open a file first.

Instructions

Execute arbitrary Aseprite Lua code in batch mode (escape hatch).

Use this when no dedicated tool covers what you need. The full API is documented at https://www.aseprite.org/api/. Anything the curated tools do can also be done here — they are Lua underneath.

Essentials for batch-mode scripts:

  • When filename is given, it is opened first and available as app.activeSprite.

  • Changes are NOT saved automatically; call spr:saveAs(spr.filename) at the end if you modified the sprite.

  • print() is the only way to return data; a clean exit does not mean your logic succeeded, so print what you need to verify.

  • Coordinates on cel images are cel-local: offset sprite-global coordinates by cel.position before getPixel/putPixel.

WARNING: this executes unrestricted code (including io/os access) on the host running Aseprite. Only pass scripts you trust.

Args: script: Lua source code to execute filename: Optional Aseprite file to open before running

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
scriptYes
filenameNo
Behavior5/5

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

Given no annotations, the description fully carries the burden. It warns that changes are not saved automatically, print() is the only way to return data, coordinates are cel-local, and includes a security warning about unrestricted code execution. Comprehensive disclosure.

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?

Well-structured with clear sections: purpose, when to use, essentials, warning, and args. Front-loaded with the key purpose. Every sentence adds value; no wasted words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Covers essential behaviors, safety, and return mechanism (print). Lacks explicit error handling or return value explanation, but the tool's nature (arbitrary code) makes full enumeration impractical. Adequate given complexity.

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 coverage is 0%, so the description must clarify parameters. It lists both script and filename with brief explanations, adding essential meaning beyond the schema. Could include more detail on script format or file types but sufficient for basic understanding.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states 'Execute arbitrary Aseprite Lua code in batch mode (escape hatch)' providing a specific verb and resource. It distinguishes itself from sibling tools by positioning as an escape hatch when no dedicated tool covers the need.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly states 'Use this when no dedicated tool covers what you need' and provides essentials for batch-mode scripts. Nearly all necessary usage guidance, though explicit when-not to use is absent.

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/NosytLabs/aseprite-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server