Skip to main content
Glama

run-jsx

Execute arbitrary ExtendScript in After Effects with the AK toolkit preloaded to automate comps, layers, keyframes, inspection, and rendering; pass a function body or absolute .jsx file.

Instructions

Execute arbitrary ExtendScript in After Effects with the AK toolkit preloaded (AK.comp, AK.layer, AK.prop, AK.setKeys with real temporal/spatial easing, AK.shape/rect/ellipse/halfDisc/star/fill/stroke, AK.slider/angle/fx, AK.sample, AK.readKeys, AK.saveFrames, AK.render, AK.inspect). Write a function BODY that returns a value (object or string) — it is wrapped, run in one undo group, and errors are returned as {error,line}. Or pass an absolute 'file' to evaluate a .jsx file as-is.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "run-jsx"
  }
}

Input Schema

NameRequiredDescriptionDefault
codeNoFunction body, e.g. `var c=AK.comp('Main'); return AK.inspect(c);`
fileNoAbsolute path to a .jsx file to evaluate (AK is NOT auto-loaded; add $.evalFile for aekit yourself).
timeoutMsNoWait for result (default 120000).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.1.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 that the body is wrapped, runs in a single undo group, and that errors come back as {error,line}. It also warns that file mode does not auto-load AK, a real failure mode. It stops short of stating that arbitrary execution can mutate the open project or what permissions/undo-reversibility mean for destructive scripts.

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?

Two sentences, front-loaded with the core action and the capability surface, then the alternative file mode. The parenthetical AK namespace list is long but earns its place as capability discovery for an open-ended execution tool. There is no filler.

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 3-parameter tool with no output schema, the description covers the return contract (object or string, or {error,line}) and the timeout default, which the agent would otherwise have to guess. It is nearly complete; only the side-effect/destructive profile of arbitrary script execution is left unstated.

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 would be 3, but the description adds meaning the schema does not: 'code' is a function BODY that must return a value, and 'file' is evaluated as-is without the AK preload. That reframes both parameters rather than restating them.

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 opens with a specific verb and resource: 'Execute arbitrary ExtendScript in After Effects', then narrows scope by naming the preloaded AK toolkit and the two input modes. An agent can tell this is a code-evaluation tool, though it never explicitly distinguishes itself from the sibling 'run-script'.

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?

The two modes are clearly routed: supply a function body via 'code' that returns a value, or pass an absolute 'file' to evaluate a .jsx as-is. That is genuine mode-selection guidance. What is missing is any when-not guidance or explicit comparison to the sibling 'run-script', leaving the agent to infer which of the two execution tools to pick.

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