Skip to main content
Glama

Set layer fill

set_layer_fill
Destructive

Set a layer's fill. The canvas backdrop is the pinned is_background image_layer (its element id is exposed via describe_video as background.elementId; the literal 'background.canvas' is also accepted as a synonym); null is rejected on the backdrop. Shapes require a Fill (null/missing is rejected). Image / video / text / group layers accept a Fill object (or #rrggbb hex) to paint a backdrop, or null to clear it — clearing removes the layer's fill colour keyframes too, so an animated backdrop really does go away. Shapes paint their body; image/video paint behind the bitmap; groups paint a rect centred on the pivot sized by (box_width, box_height). REFUSED on a layer whose fill is ANIMATED (it has colour keyframes): the track wins at every frame, so a plain fill write would be invisible. Change it at a frame with add_color_keyframe, or pass clear_animation:true to replace the animation with this fill.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fillYesEither '#rrggbb' (promoted to solid) or a Fill object: {type:"solid",color} / {type:"linear",stops:[{pos:0..1,color}],angle?} / {type:"radial",stops:[{pos:0..1,color}],cx?,cy?,radius?} / {type:"mask",layer_id,color}. A gradient is ONE fill — don't fake it with stacked shapes. null (image/video/text/group only) clears the backdrop, including any fill colour keyframes on it.
elementIdYesshapes.<id> / image.<id> / video.<id> / group.<id>. The pinned is_background image_layer is the canvas backdrop; the literal 'background.canvas' is accepted as a synonym.
projectIdYesOpaque project id (a v4 UUID, from list_projects/create_project). Selects which existing project this call mutates.
clear_animationNoOnly meaningful on a layer whose fill is animated. true = this fill REPLACES the colour animation (its keyframes are deleted). Omitted / false = the call is refused rather than writing a fill the animation would hide.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
okYesWhether the call succeeded.
dataNoThe payload, shaped by the tool.
noteNoWhat to do next when not ready.
errorNoWhy it failed.
statusNoFor cache-backed readers: whether the answer was ready.
editorUrlNoOpens this project in the editor.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • removedInput schema / properties / anonymousToken
      Removed value: -{
      -  "description": "The token create_anonymous_account returned. This connection has no Morpha key, so every call carries it.",
      -  "type": "string"
      -}
    • changedInput schema / required
      Previous value: -[
      -  "elementId",
      -  "fill",
      -  "projectId",
      -  "anonymousToken"
      -]New value: +[
      +  "elementId",
      +  "fill",
      +  "projectId"
      +]
  2. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "description": "The result envelope every Morpha tool returns.",
      +  "properties": {
      +    "data": {
      +      "description": "The payload, shaped by the tool.",
      +      "type": [
      +        "object",
      +        "array",
      +        "string",
      +        "number",
      +        "boolean",
      +        "null"
      +      ]
      +    },
      +    "editorUrl": {
      +      "description": "Opens this project in the editor.",
      +      "type": "string"
      +    },
      +    "error": {
      +      "description": "Why it failed.",
      +      "type": "string"
      +    },
      +    "note": {
      +      "description": "What to do next when not ready.",
      +      "type": "string"
      +    },
      +    "ok": {
      +      "description": "Whether the call succeeded.",
      +      "type": "boolean"
      +    },
      +    "status": {
      +      "description": "For cache-backed readers: whether the answer was ready.",
      +      "enum": [
      +        "ready",
      +        "not-ready"
      +      ],
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "ok"
      +  ],
      +  "type": "object"
      +}
  3. Changed2 schema fields changed
    • addedInput schema / properties / anonymousToken
      Added value: +{
      +  "description": "The token create_anonymous_account returned. This connection has no Morpha key, so every call carries it.",
      +  "type": "string"
      +}
    • changedInput schema / required
      Previous value: -[
      -  "elementId",
      -  "fill",
      -  "projectId"
      -]New value: +[
      +  "elementId",
      +  "fill",
      +  "projectId",
      +  "anonymousToken"
      +]
  4. Changed1 schema field changed
    • addedInput schema / properties / fill / type
      Added value: +[
      +  "string",
      +  "object",
      +  "null"
      +]
  5. First observed

TDQS

A5/5.0
Behavior5/5

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

Despite annotations already indicating destructiveness, the description adds substantial behavioral context: clearing removes fill color keyframes, null is rejected on the backdrop, shapes require a Fill, animated fills are refused because the track wins, and the geometry of group fills is defined by box_width/box_height centered on the pivot. This meaningfully exceeds annotation-only knowledge.

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?

The description is dense but every clause earns its place. The core action is front-loaded, followed by necessary edge-case behavior, paint semantics, and refusal conditions. Despite its length, the structure is logical and there is no filler or repetition of schematic details.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complex layer-type variations, the animation-refusal rule, and the schema already documenting fill structures, the description covers all decision-relevant behavior an agent needs. It also points to describe_video for finding the backdrop element id. With an output schema present, no additional return-value explanation is required.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

While schema coverage is 100%, the description adds important nuance beyond the schema: null's keyframe-removal behavior, the 'background.canvas' synonym, backdrop-specific rejection of null, and the meaning of clear_animation true vs omitted/false. These details are not inferable from parameter names alone.

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?

The description opens with a direct verb and resource: 'Set a layer's fill.' It then elaborates precise semantics per layer type (shapes vs image/video/text/group vs backdrop), which makes the tool's role unmistakable and distinguishes it from related fill/animation tools like add_color_keyframe. This is far more than a tautology.

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 description explicitly states when the call is refused ('REFUSED on a layer whose fill is ANIMATED') and prescribes the alternative: 'Change it at a frame with add_color_keyframe, or pass clear_animation:true.' It also clarifies when null is or is not acceptable per layer type, giving agents clear decision rules for invocation.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources