Skip to main content
Glama

execute-script

Run any ExtendScript code in Adobe After Effects to automate tasks like creating masks, adjusting 3D layers, or batch editing layers. Returns JSON-serializable results for integration.

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.
Behavior4/5

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

No annotations are provided, so the description bears full responsibility. It explains the execution environment (function body), error handling (message and line number), and that the script runs inside an undo group. It implies destructive potential by calling it 'the most powerful tool', but could be more explicit about possible side effects.

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 a single, well-structured paragraph. It front-loads the main purpose and provides details without redundancy. Every sentence adds value, covering usage, constraints, and examples. It is concise yet comprehensive.

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?

Given the tool's complexity (arbitrary code execution) and the absence of an output schema, the description thoroughly explains input parameters, return value expectations, error handling, and execution context. It includes a practical example, making it complete for an AI agent to use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/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 significant value beyond the schema: it explains the script parameter runs as a function body, provides an example, and clarifies timeoutMs for long-running scripts. This enriches 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 the tool executes arbitrary ExtendScript in After Effects and returns results. It explicitly distinguishes itself from sibling tools by stating it covers anything not covered by dedicated tools, listing many examples like masks, track mattes, 3D layers, etc.

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

Usage Guidelines5/5

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

The description provides explicit guidance: 'use it for anything the dedicated tools do not cover', implying when to use it. It also gives usage instructions like running as a function body, returning JSON-serializable values, and not calling app.beginUndoGroup. This effectively separates it from sibling tools.

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/a-y-ibrahim/after-effects-mcp'

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