Skip to main content
Glama

ae_run_jsx

Execute ExtendScript code in After Effects to automate compositing, inspect layers, and modify properties. Pass data via args; long runs return a commandId for later retrieval.

Instructions

Run arbitrary ExtendScript (ES3 JavaScript) inside After Effects. The value of the last expression is returned (AE objects come back as short summaries). Pass data through args (available as the args variable) instead of pasting it into the code. Helpers: mcp.findComp(nameOrId?), mcp.findLayer(comp, nameOrIndex), mcp.activeComp(), mcp.layerType(layer), mcp.projectInfo(); lib.prop(layer, 'Transform/Position'), lib.setValue(prop, value, time?), lib.color('#ff8800'), lib.tree(propertyGroup, depth, withValues). The whole call is one undo step. If it runs longer than the timeout, a commandId is returned: fetch the result with ae_get_result, do not re-send the code.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
argsNoOptional data exposed to the code as `args`.
codeYesExtendScript code. ES3 only: var, no arrow functions, no let/const.
timeoutMsNoHow long to wait before returning a commandId (default 30000, max 3600000).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.0

TDQS

A4.1/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does so well: it discloses the return semantics (last expression's value, AE objects as short summaries), atomicity ("the whole call is one undo step"), and the async timeout contract (a commandId is returned and must be fetched with ae_get_result, not re-sent). These are exactly the non-obvious behaviors an agent needs before invoking a code-execution tool.

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?

Purpose is front-loaded in the first sentence and each following sentence adds distinct value (return value, args, helper catalog, undo atomicity, timeout recovery). The dense helper-list is the only slightly listy stretch, but it is informative rather than padding.

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

Completeness5/5

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

There is no output schema, so the description correctly explains return values itself, and it also covers runtime constraints, the args channel, available helpers, atomicity, and the timeout/recovery path. An agent has everything needed to call it correctly; only sibling disambiguation is missing.

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, but the description adds real meaning by explaining that `args` is exposed to the code as the `args` variable and that timeoutMs governs when a commandId is returned. That is value beyond the schema, though `code`/ES3 constraints are already restated in the schema.

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?

States a specific verb and resource ("Run arbitrary ExtendScript inside After Effects") plus the runtime dialect (ES3), so an agent immediately knows what executes. It does not explicitly differentiate itself from the sibling ae_run_jsx_file, which is the obvious near-twin, so it stops short of a 5.

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

Usage Guidelines3/5

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

It gives operational guidance -- pass data via `args` rather than pasting, and fetch results with ae_get_result after a timeout instead of re-sending -- which is genuinely useful. But it never states when to reach for this versus ae_run_jsx_file or the many high-level siblings (ae_set_property, ae_create_comp, etc.), so selection guidance is only implied.

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