Skip to main content
Glama

nest_composition

Places one composition inside another as a layer—e.g., a 9:16 card in a 16:9 video—preserving its size, frame rate, timing, and camera while positioning, scaling, fitting, or looping it.

Instructions

Place one composition inside another as a layer (a precomp, as in After Effects): a 9:16 card in a 16:9 video, a 4K shot shrunk into a frame. The nested one keeps its own size, frame rate, nested compositions and camera and plays from the element's start (seconds into the element) at rate, beginning in seconds into it; past its end it is gone unless loop. Its box is w × h (default: its own size, so scale 1 is pixel for pixel; scale and keyframes move it like any layer), filled by fit: contain (whole picture, default), cover (fills, cropped) or fill (stretched). It paints its own background unless its meta.background is "transparent". A composition cannot nest itself, directly or through others. The layer is type "composition" with props.composition; change it later with set_props, set_motion, set_keyframe.

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": {
      "composition": "<composition>",
      "nested": "<nested>"
    },
    "name": "nest_composition"
  }
}

Input Schema

NameRequiredDescriptionDefault
hNoBox height in px (default: the nested composition's height)
wNoBox width in px (default: the nested composition's width)
xNoCentre x in px (default: the frame centre)
yNoCentre y in px (default: the frame centre)
idNoElement id (default: the nested composition's name)
inNoSeconds into the nested composition at the layer's start
fitNocontain
intoNoA composition nested inline in this one to put it in (default: this composition itself)
loopNoStart over at its end instead of disappearing
rateNoPlayback speed (1 = as made)
basisNoWhat you read and followed to make this change, as refs from search or lookup: rule:<lint or taste rule>, taste, feedback:<id> (earlier feedback this follows; what it answers goes in feedback), commit:<id> (an earlier change it builds on), asset:, template:, skill:… The person sees them under the change, so they know why it is this way. Name only what shaped it.
scaleNo
startNoSeconds into the element it starts playing (held on its first frame before)
nestedYesThe composition to place inside (list_compositions)
radiusNoCorner radius of the box in px
messageNoOne line saying why, kept with the change in the history
feedbackNoIds of the feedback this change answers (notes and marks from list_notes, list_examples or the conversation). When the person keeps the change it joins the record of that feedback, and when they then mark the feedback resolved it is the fix; when they take it back, the feedback opens again.
confidenceNoHow sure you are this change is what the person wants. high: they asked for exactly this, or you measured it against a reference. medium: you inferred it from the taste, a rule or earlier feedback. low: you are guessing, or it changes something they did not ask about. The person's threshold decides which changes stand by themselves and which wait for them to keep; say it honestly on every change.
compositionYesComposition name (file in compositions/ without .json)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changedv0.1.2
    • addedInput schema / properties / confidence
      Added value: +{
      +  "description": "How sure you are this change is what the person wants. high: they asked for exactly this, or you measured it against a reference. medium: you inferred it from the taste, a rule or earlier feedback. low: you are guessing, or it changes something they did not ask about. The person's threshold decides which changes stand by themselves and which wait for them to keep; say it honestly on every change.",
      +  "enum": [
      +    "high",
      +    "medium",
      +    "low"
      +  ]
      +}
    • changedInput schema / properties / id / description
      Previous value: -"Layer id (default: the nested composition's name)"New value: +"Element id (default: the nested composition's name)"
    • addedInput schema / properties / into
      Added value: +{
      +  "description": "A composition nested inline in this one to put it in (default: this composition itself)",
      +  "type": "string"
      +}
    • removedInput schema / properties / scene
      Removed value: -{
      -  "description": "Scene id (default: the first scene)",
      -  "type": "string"
      -}
    • changedInput schema / properties / start / description
      Previous value: -"Scene seconds it starts playing (held on its first frame before)"New value: +"Seconds into the element it starts playing (held on its first frame before)"
  2. First observedv0.1.0

TDQS

A4.3/5.0
Behavior5/5

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

Annotations only establish that this is a non-idempotent, non-destructive mutation. The description goes well past that: the nested composition retains its own size, frame rate, nested children and camera; playback timing is defined in terms of start/rate/in/loop including that the layer is held on its first frame before `start` and vanishes after its end unless loop; the box defaults to the nested composition's own size so scale 1 is pixel-for-pixel; and the self-nesting cycle rule is disclosed.

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 operation and the reason for it, then timing, then box/fit, then constraints, then the follow-up tools. It is dense but nearly every clause earns its place; the parenthetical examples (9:16 card in 16:9, 4K shot in a frame) are illustrative overhead, and the single wall of prose is harder to scan than it needs to be for this much semantics.

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 19-parameter mutation with no output schema, the description covers the operation's semantics, geometry, timing and the self-nesting prohibition, while the schema handles the provenance parameters (basis, feedback, message, confidence). The main omission is what the tool returns (the new element's id, presumably), which an agent must infer before chaining set_props or set_motion.

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 89%, so the schema already carries most parameter definitions and 3 would be the baseline. The description still adds real meaning on top: it explains why w/h default to the nested size (pixel-for-pixel scale), spells out what contain/cover/fill actually do to the picture, and repeats the hold-before-start timing behavior so the timing trio is interpretable together.

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?

"Place one composition inside another as a layer (a precomp)" gives a specific verb, a specific resource, and the conventional name for the operation. It also pins the result shape ("The layer is type \"composition\" with props.composition"), which separates it cleanly from sibling constructors like new_composition or put_composition.

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?

Guidance is implied rather than stated: the description closes by routing later edits to set_props, set_motion and set_keyframe, and it names a hard precondition (a composition cannot nest itself, directly or indirectly). But it never says when to reach for this instead of assembling layers another way, and never points to list_compositions as the discovery step the way the schema does.

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