Skip to main content
Glama
23d1
by 23d1

Run ExtendScript

ae_run_script

Execute arbitrary ExtendScript in After Effects to handle masks, text animators, and other unsupported operations. Pass args and return JSON results.

Instructions

Run arbitrary ExtendScript inside After Effects. This is the escape hatch for anything the other tools don't cover — masks, shape operators, text animators, puppet pins, the lot.

The script body runs as a function: use return <value> to send JSON-serialisable data back. The full AE scripting API is available (app, app.project, ...), plus the AEMCP helpers used by this server: AEMCP.comp(ref), AEMCP.layer(comp, ref), AEMCP.prop(root, path), AEMCP.color(hex), AEMCP.time(comp, t), AEMCP.serializeLayer(layer), AEMCP.setKeys(prop, comp, keys, opts).

Pass args to hand data to the script: it arrives as the ARGS variable (null when omitted). Prefer that over pasting values into the source — it keeps quoting and non-ASCII text correct.

Remember: this is ES3. No JSON, no arrow functions, no let/const, no Array.forEach.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
argsNoAny JSON value, available to the script as `ARGS`.
scriptYesExtendScript source. Use `return` to produce a result.
undoLabelNoWrap the script in an undo group with this label. Omit for read-only scripts.
timeoutSecondsNoDefault: 120.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.6/5.0
Behavior5/5

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

The description discloses a great deal beyond the sparse annotations: the script runs as a function with return-value serialisation, the full AE API plus AEMCP helpers are available, args arrive as ARGS, and ES3 restrictions apply. This materially changes how an agent writes the script.

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 dense but every sentence carries operational information: purpose, execution model, helpers, args guidance, and ES3 constraints. It is well-structured and front-loaded with the core purpose.

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?

For a high-complexity arbitrary-code tool with no output schema, the description covers purpose, execution semantics, helper API, argument passing, and language limitations. It doesn't explicitly state error behaviour or what happens when no return is used, but it is otherwise complete enough for an agent to invoke it correctly.

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 100%, so the baseline is 3. The description adds valuable semantics beyond the schema: the script body is a function, return values are JSON-serialisable, args arrive as ARGS, and args are preferred over pasting values. UndoLabel and timeoutSeconds are left to the schema, but that is acceptable.

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?

Description opens with 'Run arbitrary ExtendScript inside After Effects' — a specific verb and resource. It then positions itself as 'the escape hatch for anything the other tools don't cover', clearly distinguishing it from the large sibling set.

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?

It explicitly says to use this when other tools don't cover the need, and gives examples (masks, shape operators, text animators, puppet pins). It does not name specific alternatives or state when not to use it, but the guidance is clear enough for an agent to route to it.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.