Skip to main content
Glama

add_mask

Creates a mask on an After Effects layer from a rectangle, ellipse, or custom vertices, with optional feather, expansion, opacity, and mode to control layer visibility.

Instructions

Create a mask on a layer. mode maps to MaskMode (add/subtract/intersect/difference/none; default add). shape is optional: an explicit {vertices,inTangents,outTangents,closed} OR a primitive {rect:[x,y,w,h]} / {ellipse:[x,y,w,h]} with a top-left origin (a 4-point rect or a 4-anchor bezier ellipse is generated). feather ([x,y] or a single number), expansion (px), and opacity (0-100) are optional. Returns {mask,index,mode,closed}.

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>"
    },
    "name": "add_mask"
  }
}

Input Schema

NameRequiredDescriptionDefault
compNoComp: name, numeric id, or { id: N } for duplicate-name-safe stable-id addressing.
modeNo
nameNo
layerYesLayer: name (string), 1-based index (integer), or { id: N } for duplicate-name-safe stable-id addressing.
shapeNoExplicit vertices/tangents OR a rect/ellipse primitive.
featherNoMask feather: a number (applied to x and y) or [x,y].
opacityNo
instanceNoTarget a specific AE when more than one is connected (e.g. "2026", "2025", or a major like "26"). Omit when only one AE is open — see list_instances.
expansionNoMask expansion in px.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.0

TDQS

A3.8/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 a rect/ellipse primitive is auto-converted into concrete geometry (4-point rect, 4-anchor bezier ellipse), that the origin is top-left, the units for feather/expansion/opacity, and the return payload {mask,index,mode,closed}. It omits error behavior, whether existing masks are modified, and any permission or instance-targeting caveats beyond the schema.

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?

It is a single dense paragraph that front-loads the action and then walks optional inputs in a predictable order with zero filler. Parenthetical unit annotations keep it compact, though the shape sentence is long enough that light structure would aid scanning.

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 9-parameter tool with nested objects and no output schema, the description covers the tricky geometry semantics, defaults, units, and the return shape, which is enough to call it correctly. Remaining gaps (comp/name/instance semantics, error behavior) are largely handled by the schema's own descriptions.

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 67%, and the description compensates on the highest-risk parameters: mode is mapped to MaskMode with a default, shape is explained as either explicit vertices/tangents or a primitive with a top-left origin, feather accepts a number or [x,y], and expansion/opacity units are given. comp, name, and instance are left entirely to the schema, so it adds meaning without fully covering all nine parameters.

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 opening sentence gives a specific verb and resource ('Create a mask on a layer'), which cleanly separates it from other add_* siblings such as add_shape or add_solid. It doesn't explicitly name a sibling or state scope limits (e.g., masks per layer, single-comp targeting), so it falls short of a 5.

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

Usage Guidelines3/5

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

Usage is implied by the verb plus the enumeration of optional inputs, and defaults are stated for mode ('default add'), which helps invocation. However, there is no explicit when-to-use/when-not guidance, no mention of alternatives (e.g., adding an existing mask vs. generating one from a shape), and no stated prerequisites or failure conditions.

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