Skip to main content
Glama

align_to_targets

Batch-centers layers on target layers in comp space, resolving full parent chains and offsets so elements parented to scaled or rotated nulls align correctly.

Instructions

Batch paired alignment: center each layer's comp-space visual center onto its target layer's center, plus an optional offset. Unlike align_layers (own-transform only), this walks the FULL parent chain, so labels/numbers parented to scaled or rotated nulls/buttons resolve to true comp coordinates and land correctly. Pair via pairs:[{layer,target}] or parallel layers[]+targets[]. offset [dx,dy] is comp px added to every target center (same offset on all pairs = uniform "normalize"). axis locks an axis (x/y/both). Solves each layer's LOCAL position from the comp-space target, so non-uniform/animated parent scale is handled exactly. Skips layers whose Position has an active expression. 2D layers only (3D/camera not projected). e.g. center "Num N" on "Key N" with offset [0,-23], then "Letters N" on "Key N" with [0,50].

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": "align_to_targets"
  }
}

Input Schema

NameRequiredDescriptionDefault
axisNoboth
compNoComp: name (string), or { id: N } for duplicate-name-safe stable-id addressing. Defaults to active comp.
timeNo
frameNo
pairsNoExplicit (layer, target) pairs.
layersNoOne or many layers (each: name, 1-based index, or { id: N }). If omitted, uses currently selected layers.
offsetNocomp-space [dx,dy] added to each target center. default [0,0].
targetsNoReference layer(s), zipped 1:1 with layers[] when pairs is omitted.
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.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.0

TDQS

A4.5/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 well: it discloses that the full parent chain is walked, that local Position is solved from the comp-space target so non-uniform/animated parent scale is handled exactly, that expression-driven Position layers are skipped, and the 2D-only limitation. It stops short of saying what is returned for skipped layers, whether the operation is undoable as a single step, or how the instance parameter behaves when AE count is zero.

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?

Front-loaded with the one-line purpose, then differentiation, then mechanics, then constraints and examples — a sensible order. It is dense and uses slash/quote shorthand ('labels/numbers', '"Num N"'), which costs a little readability but almost no sentence is wasted.

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 nine-parameter, no-annotation, no-output-schema mutation tool, the description covers the mechanics, constraints, and an example thoroughly enough to call correctly. The main residual gap is return behavior and error/partial-success reporting when some pairs are skipped.

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 adds real meaning beyond it: pairs as {layer,target} vs the parallel layers[]+targets[] zip, offset as comp pixels added to every target center (with the 'uniform normalize' interpretation), and axis locking x/y/both. The time/frame and instance parameters are not explained in the description, leaving modest gaps.

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 and resource ('Batch paired alignment: center each layer's comp-space visual center onto its target layer's center') and immediately names the sibling it differs from (align_layers, 'own-transform only'). An agent can tell exactly what this does and how it differs from the nearest alternative without opening a schema.

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?

Explicitly contrasts with align_layers and gives the condition that selects this tool: parents in the chain that are scaled or rotated. It also states exclusions (layers with an active Position expression are skipped, 2D layers only, 3D/camera not projected) and provides two concrete worked examples with offsets.

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