Skip to main content
Glama

Set matte source

set_matte_source
Destructive

Set (or clear) a track matte — the host shows only where the matte source is opaque. The HOST can be a leaf (image., video., shapes., text.) OR a group. (a group is a layer of sorts): a group host clips ALL its composited children to the source shape's path — e.g. a marching chevron strip + black backing shown only inside an arrow / band shape. For a leaf host the source can be any leaf (use a text. source for video-/image-filled letterforms); for a group host the source must be a shape (shapes.). The source is CONSUMED: it stops painting as a layer of its own, so do NOT set its opacity to 0 (an invisible stencil empties the mask and the host vanishes); hiding it changes nothing, since its hidden flag does not feed the mask. It has no time window of its own: it follows the host's, and attaching drops its block and edge transitions (source_window_dropped in the result). Its position, scale, rotation and keyframes shape the mask. Pass null to clear.

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": {
      "elementId": "<elementId>",
      "matte_source_id": "<matte_source_id>",
      "projectId": "<projectId>"
    },
    "name": "set_matte_source"
  }
}

Input Schema

NameRequiredDescriptionDefault
elementIdYesHost being masked: image/video/shapes/text.<id>, or group.<id>.
projectIdYesOpaque project id (a v4 UUID, from list_projects/create_project). Selects which existing project this call mutates.
matte_invertedNoOptional. Invert the mask (knock-out): the host shows everywhere EXCEPT where the source is opaque — a punch-through / spotlight. Honored on leaf hosts; ignored on group hosts. Omitted = preserve current; clearing the mask resets it.
matte_source_idYesElement id of the layer whose alpha drives the mask, or null to clear.

Output 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",
      -  "matte_source_id",
      -  "projectId",
      -  "anonymousToken"
      -]New value: +[
      +  "elementId",
      +  "matte_source_id",
      +  "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",
      -  "matte_source_id",
      -  "projectId"
      -]New value: +[
      +  "elementId",
      +  "matte_source_id",
      +  "projectId",
      +  "anonymousToken"
      +]
  4. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Well beyond what readOnlyHint=false / destructiveHint=true convey: it discloses that the source is CONSUMED and stops painting, that hidden flags don't feed the mask, that the source loses its own time window and its block/edge transitions are dropped (naming the `source_window_dropped` result field), and that position/scale/rotation/keyframes shape the mask. These are non-obvious, hard-to-recover side effects an agent cannot infer from annotations or 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?

Purpose is front-loaded in the first clause and the rest proceeds from host types to source rules to the consumption gotcha to the clearing instruction. It is dense and occasionally repetitive (the invisibility warning is restated twice), but every point is a real footgun report rather than filler.

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?

For a destructive, type-constrained mutation the description covers valid inputs, side effects, transition loss, and clearing. An output schema exists and the description even names the one result field worth watching (`source_window_dropped`), so return values need no further explanation.

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 100% so the baseline is 3, but the description adds a constraint absent from the schema: matte_source_id must be a shape when the host is a group, and may be any leaf for a leaf host. That material type-restriction on the nullable parameter justifies going above baseline; the null-to-clear semantics duplicate the schema, limiting it to 4.

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?

Names a specific operation (set/clear a track matte) and immediately defines its semantics: the host shows only where the matte source is opaque. It goes further by enumerating valid host types (leaf vs group.<id>) and what each produces, so an agent can distinguish this from any other layer mutation in the sibling list.

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

Usage Guidelines4/5

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

Gives concrete conditional guidance: leaf hosts accept any leaf source (text.<id> for filled letterforms), group hosts require a shapes.<id> source, and null clears. It also supplies an explicit anti-pattern ("do NOT set its opacity to 0"), which is unusually actionable. It stops short of the top score only because there is no sibling alternative to route away to, so the when-vs-alternatives axis doesn't apply.

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