Skip to main content
Glama

Set expression

set_expression

Assign an After Effects expression to any layer property, with immediate evaluation and returns of expression errors plus the resulting value so you can validate animation logic.

Instructions

Set an expression on any property. Returns expressionError when AE reports one (the expression is evaluated right away), and the resulting value.

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": {
      "layer": "<layer>",
      "property": "<property>",
      "expression": "<expression>"
    },
    "name": "set_expression"
  }
}

Input Schema

NameRequiredDescriptionDefault
compNoComposition name, 'Folder/Name' path, or item id. Omit to use the active composition.
layerYesLayer: 1-based index, layer name, or {id}/{index}/{name}. 'selected' = first selected layer.
enabledNoEnable it (default true).
propertyYesProperty path, '/'-separated, by display name, matchName or 1-based index. Shortcuts: 'Position', 'Scale', 'Rotation', 'Opacity', 'Anchor Point', 'Source Text', 'Time Remap', 'Audio Levels'. Examples: 'Transform/Position', 'Effects/Gaussian Blur/Blurriness', 'Contents/Rectangle 1/Fill 1/Color', 'Masks/Mask 1/Mask Feather'.
expressionYesExpression source (AE JavaScript engine).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

B3.2/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=false, destructiveHint=false, openWorldHint=false, so the safety profile is covered. The description adds real value beyond that: the expression is evaluated immediately, an expressionError can be returned by AE, and the resulting value is included. It does not say whether an existing expression is overwritten or how failure leaves the property state.

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 compact sentences, front-loaded with the action, followed by return behavior. The parenthetical "(the expression is evaluated right away)" is slightly awkwardly placed but carries useful information rather than waste.

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?

Five parameters at full schema coverage and no output schema, so the description only needs to cover what the schema cannot: it discloses the immediate evaluation and the error/value return, which is the key behavioral fact for a write tool. Overwrite semantics for an existing expression are the remaining gap.

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 100%, with comp, layer, enabled, property, and expression each documented in-schema, including allowed shortcuts and path examples. The description only reasserts "any property" and adds nothing about the expression source format or the enabled flag, so the schema does the heavy lifting.

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: "Set an expression on any property," and adds that the result value and any expressionError are returned. It does not differentiate from close siblings such as enable_expression, remove_expression, or set_expressions_bulk, so the agent must infer the boundary.

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

Usage Guidelines2/5

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

There is no when-to-use or when-not-to-use guidance. Nothing tells the agent how this differs from enable_expression (toggling an existing expression) or set_expressions_bulk (multi-property writes), even though those are the obvious selection alternatives.

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

Deploy Server

Other Tools