Skip to main content
Glama

Run custom ExtendScript

run_extendscript

Run custom ExtendScript inside After Effects to handle tasks not covered by other tools, with access to the CS style library and returnable results in one undo group.

Instructions

Escape hatch for anything the other tools don't cover. Code is a function body (ES3: var, no arrow functions, no JSON); return a value to get it back. The style library is available as CS.* (CS.comp, CS.layer, CS.animate, CS.addEffect, CS.profile …). Wrapped in one undo group.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "code": "<code>"
    },
    "name": "run_extendscript"
  }
}

Input Schema

NameRequiredDescriptionDefault
codeYes
labelNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4/5.0
Behavior4/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 substantial work: it discloses the ES3 language constraint (var, no arrow functions, no JSON), that `return` propagates a value back, that a CS.* style library is injected, and that execution is wrapped in a single undo group. It does not describe failure behavior (e.g. what happens on a thrown error) or whether arbitrary project mutations are permitted, leaving a real gap for an arbitrary-code tool.

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?

Three tight sentences, each earning its place: purpose first, then the code contract, then the available API surface and undo semantics. No filler and the most decision-relevant information is front-loaded.

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 an unannotated, no-output-schema code-execution tool this is close to sufficient — it covers syntax constraints, return values, injected API, and undo grouping. The remaining omissions are error semantics and the `label` parameter, which matter but are secondary to the contract already given.

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

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate, and it does well for `code` — function-body semantics, ES3 syntax limits, and return-value behavior are all things the schema does not say. The optional `label` parameter is never mentioned, so half the parameter surface remains undocumented.

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?

The description states a concrete verb-and-resource pair (run custom ExtendScript) and frames it as the 'escape hatch' fallback, which tells an agent how it differs from task-specific siblings like add_text or animate_layer. It stops short of naming a sibling explicitly, but the differentiating role is unambiguous.

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?

'Escape hatch for anything the other tools don't cover' gives a clear selection rule: use this only when no dedicated tool fits. There is no explicit when-not or warning about preferring the higher-level tools for common tasks, so guidance is clear but not exhaustive.

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