Skip to main content
Glama

Center layers in comp

center_layers

Centers selected layers' visible content horizontally, vertically, or both in a composition, using measured bounds so rotated and 3D layers align by their actual content.

Instructions

Center layers' visible content in the composition, horizontally, vertically or both. Bounds = axis-aligned box of the layer's content (sourceRectAtTime) after scale/rotation/parenting, in comp pixels. Rotated layers are aligned by their rotated bounding box. 3D layers are measured through the active camera and moved iteratively (approximate). Animated positions are shifted as a whole (all keyframes). Cameras/lights are not allowed.

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

Input Schema

NameRequiredDescriptionDefault
axisNox = horizontal only, y = vertical only (default both).
compNoComposition name, 'Folder/Name' path, or item id. Omit to use the active composition.
timeNoComp time at which content bounds and transforms are measured (default: current time).
layersNoLayers: array of layer refs, or 'selected' (default) or 'all'.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.7/5.0
Behavior4/5

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

Beyond the annotations (which only declare not-readOnly and non-destructive), the description discloses real behavioral traits: how bounds are computed (sourceRectAtTime after scale/rotation/parenting), that rotated layers use their rotated bounding box, that 3D alignment is iterative and approximate, and that animated positions shift as a whole across all keyframes. The main omission is what property is actually mutated and whether the change is a single undoable step.

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?

The action is front-loaded in the first sentence, with constraint and edge-case notes following in a compact sequence. Every sentence carries information; the technical phrasing ('sourceRectAtTime', 'axis-aligned box') is dense but appropriate for a professional API. Minor cost is that the constraint clauses read as a list rather than being organized by importance.

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 4-parameter mutation tool with no output schema, the definition covers the hard parts: measurement basis, rotation handling, 3D approximation, keyframe side effects, and disallowed layer types. It stops short of stating the mutated property or undo semantics, which is the remaining gap given the light annotation coverage.

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 coverage is 100%, so the schema already documents axis, comp, time, and layers, establishing the baseline of 3. The description adds the meaning of the measurement basis used by the tool ('axis-aligned box of the layer's content ... in comp pixels'), which indirectly clarifies what the time parameter measures, but it does not elaborate on layer reference resolution or axis behavior beyond the schema.

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?

Opens with a specific verb and resource ('Center layers' visible content in the composition') and immediately scopes it to horizontal, vertical, or both. It is distinguishable from centering on an anchor point because it explicitly says the reference is the layer's visible content bounds rather than its anchor. It never names the closest sibling, align_layers, so the boundary between the two remains implicit.

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 purpose statement and by the constraints ('Cameras/lights are not allowed'), which tell the agent what inputs are invalid. There is no explicit when-to-use vs. when-to-pick-an-alternative guidance, and no mention of align_layers or center_anchor_point as different approaches to a similar goal.

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