Skip to main content
Glama

execute-script

Run arbitrary ExtendScript in After Effects for advanced control over masks, 3D layers, parenting, and batch edits, returning JSON-serializable results.

Instructions

Run ARBITRARY ExtendScript (the After Effects scripting DOM) inside After Effects and return the result. This is the most powerful tool: use it for anything the dedicated tools do not cover - masks, track mattes, parenting, 3D layers/cameras/lights, blending modes, precomposing, time remapping, layer styles, text animators, puppet pins, importing/replacing footage, batch edits across many layers, project-wide changes, etc. Your code runs as the body of a function, so use return <value>; to send data back, and return only JSON-serializable values (numbers, strings, arrays, plain objects). The whole script already runs inside one undo group, so do NOT call app.beginUndoGroup yourself. Use app and app.project to reach everything. On error you get back the message and line number. Example script: "var c = app.project.activeItem; return { name: c.name, layers: c.numLayers };"

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
scriptYesExtendScript code to execute. Runs as a function body; use 'return value;' to return JSON-serializable data. Do not call app.beginUndoGroup (handled automatically).
timeoutMsNoHow long to wait for the result, in milliseconds (default 60000). Increase for long-running scripts.
Behavior5/5

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

No annotations are provided, so the description carries full burden. It discloses critical behaviors: code runs as a function body, must return JSON-serializable values, the script is wrapped in a single undo group, and errors return message plus line number. It also notes not to call beginUndoGroup.

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 provides necessary guidance. It is front-loaded with the core purpose and immediately follows with usage examples and critical constraints. No redundant filler.

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?

For a tool that executes arbitrary code, the description is remarkably complete. It covers return contract, serialization, undo behavior, access points, error format, and gives a concrete example. No output schema exists, so the description correctly takes on the burden of explaining what to expect.

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%, but the description significantly enhances the script parameter by explaining the function-body execution model, return value requirements, and error behavior. The timeoutMs parameter is only described in the schema, but the description adds no further detail, which is acceptable given full schema coverage.

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 the tool runs arbitrary ExtendScript in After Effects and returns the result. It also differentiates from sibling tools by positioning itself as the catch-all for cases not covered by dedicated tools.

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 provides explicit guidance to use the tool for anything the dedicated tools do not cover, with a long list of examples. It clearly implies the alternative (dedicated tools) but does not name specific sibling tools or provide an explicit 'when not to use' 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/omar-hesham/after-effect-mcp-with-claude'

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