Skip to main content
Glama

Set expression

ae_set_expression
DestructiveIdempotent

Set, replace, or clear an After Effects property expression, optionally enable or disable it, and return the resulting value plus any reported error.

Instructions

Set, replace or clear (empty string) the expression on one property. Returns the expression, whether it is enabled, any error AE reports and the resulting value at the current time. To try an expression without keeping it use ae_check_expression, to edit text across many expressions ae_replace_in_expressions, to list them ae_get_expressions (all via ae_call).

Input Schema

NameRequiredDescriptionDefault
compNoComposition: item id (number) or exact name. Omit (or "active") for the active/open composition.
pathYesProperty path from the layer, "/"-separated display names or match names, e.g. "Transform/Position", "Effects/Gaussian Blur/Blurriness", "ADBE Transform Group/ADBE Opacity", "Contents/Rectangle 1/Fill 1/Color".
layerYesLayer: 1-based index (number) or exact layer name.
enabledNoSet false to keep the expression but switch it off, true to switch it on (ignored when clearing).
expressionYesExpression code; an empty string removes the expression.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.1.3
    • addedInput schema / properties / enabled / description
      Added value: +"Set false to keep the expression but switch it off, true to switch it on (ignored when clearing)."
    • addedInput schema / properties / expression / description
      Added value: +"Expression code; an empty string removes the expression."
  2. First observedv0.1.0

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true, idempotentHint=true and readOnlyHint=false, so the safety profile is covered; the description adds the return payload (expression, enabled flag, AE error, evaluated value at current time), which matters since there is no output schema. It does not state that an existing expression is overwritten irreversibly or point at ae_undo, which is the main remaining behavioral gap for a destructive write.

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?

Two sentences, front-loaded with the action and the clear-case before the sibling routing list. The dense parenthetical of four tool names is information-dense rather than wasteful, and no sentence is 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 no-output-schema mutation tool, the description supplies the return fields, the clearing convention and alternatives, which is nearly everything an agent needs. It stops short of noting irreversibility of overwrite or the recovery path via ae_undo, a minor gap given destructiveHint=true.

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%, including the enabled flag and the 'empty string removes the expression' semantics, so the schema carries the parameter burden. The description only restates the empty-string clearing convention and adds the 'one property' scoping; it contributes nothing about path/layer/comp resolution beyond the schema.

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?

States a specific verb set (set, replace, clear) applied to a specific resource (an expression on one property), and the parenthetical '(empty string)' defines the clear case immediately. It explicitly distinguishes itself from ae_check_expression, ae_replace_in_expressions and ae_get_expressions, so an agent can differentiate without opening other schemas.

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 second sentence gives explicit routing rules: use ae_check_expression to try without keeping, ae_replace_in_expressions for bulk text edits, ae_get_expressions to list. Each alternative comes with the condition that selects it, and it notes all are reached via ae_call.

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