Skip to main content
Glama

Add text layer

add_text_layer

Create a new text layer — a first-class leaf that animates, groups, and z-orders exactly like an image or shape. The renderer draws live typeset text (multi-line, auto-fit to the box). Defaults: x/y = canvas centre, width 900, height 320, font_family "Hanken Grotesk", text_size derived from existing text layers (or ~10% of canvas height). Also accepts full type styling: font_weight (100-900), font_style (italic), text_transform, letter_spacing, line_height, text_align, text_autofit ("hug" default = box shrink-wraps the text at the fixed text_size, honouring literal newlines, so it can't re-wrap between preview and export — bake your own "\n" line breaks / "wrap"=fixed size + word-wrap to the box / "fit"=auto-size to fill the box, grows and shrinks / "shrink"=legacy shrink-only), text_valign (top/middle/bottom), an outline (stroke_width + stroke_color), and text_shadow. Returns the new layer's id + element id (text.), plus text_box (the painted box, measured from the font's glyphs), fits ({canvas, safe_area}, judged at the layer's static position) and, when the text runs past either, a warning naming the text_size that fits: add \n line breaks or lower text_size.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
xNoCentre x in canvas px. Defaults to canvas centre.
yNoCentre y in canvas px. Defaults to canvas centre.
textNoThe text to render. Newlines are honoured as hard line breaks.
blockNoOPTIONAL timeline window — {start, duration} in composition frames. OMIT IT (the default) and the layer is ALWAYS PRESENT: a persistent overlay that holds for the whole composition, which is what an agent-placed watermark / lower-third almost always wants. Pass it to place a bounded CLIP instead (what the editor's own add does: 5 s at the playhead). Keyframes on a blocked layer are sampled RELATIVE to `start`.
curveNoCurve the text onto an arc, in degrees of total sweep. 0 = straight (default). POSITIVE = a SMILE (⌣, ends rise); NEGATIVE = an ARCH (⌒, rainbow). Clamped ±135. A tasteful smile is ~+60. Single line only (multi-line is joined while curved).
widthNoBox width in px (> 0). Default 900.
heightNoBox height in px (> 0). Default 320.
projectIdYesOpaque project id (a v4 UUID, from list_projects/create_project). Selects which existing project this call mutates.
text_sizeNoFont size in px. Omit to derive from existing text layers (median) or the canvas height.
font_styleNoItalic toggle. Default normal.
text_alignNoHorizontal alignment of each line. Default center.
text_colorNoText fill colour as #rrggbb. Defaults to white.
decorationsNoPer-character underline / strikethrough. { underline?: [{start,end}], strikethrough?: [{start,end}] } — half-open character ranges [start,end) (UTF-16 offsets) into `text`. E.g. underline the first word of "Big news": underline:[{start:0,end:3}]. Ranges are normalized (sorted + merged). Not rendered on curved text.
font_familyNoGoogle Fonts family name, e.g. "Anton". Defaults to "Hanken Grotesk".
font_weightNoFont weight 100..900 (400 regular, 700 bold, 800 black). Default 400.
line_heightNoLine height as a multiple of font size (1.2 = 120%).
text_shadowNoDrop shadow { offsetX, offsetY, blur, color }; color is any CSS colour (rgba allowed). null clears it.
text_valignNoVertical alignment of the text block within its box. "middle" (default) centres it; "bottom" pins it to the box floor so extra wrapped lines grow upward from a fixed baseline (captions use this so a wrapped line doesn't shift the others); "top" pins the ceiling.
stroke_colorNoOutline colour as #rrggbb. Defaults to white when a width is set.
stroke_widthNoOutline width in px (0 = no outline).
text_autofitNoHow text fits its box. "hug" (default for new layers): hold text_size FIXED and DERIVE the box from the measured text plus padding, honouring the literal newlines you pass — the box shrink-wraps the exact content and grows/shrinks live as the text changes, so it can never re-wrap differently between the editor preview and the export (bake your own "\n" breaks; pair with set_text_background for a rounded caption box). "wrap": hold text_size FIXED in a fixed-size box and only word-wrap (hard-breaking a single over-wide word), never resize. "fit": ignore text_size and auto-size the font BOTH ways (grow and shrink) to the largest size whose wrapped block fills the box — resizing the box resizes the text. "shrink" (legacy): word-wrap then auto-shrink the font from text_size until the block fits; never grows.
letter_spacingNoTracking between glyphs in px; may be negative. Default 0.
text_transformNoCase transform applied before layout. Default none.

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: -[
      -  "projectId",
      -  "anonymousToken"
      -]New value: +[
      +  "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. Changed1 schema field changed
    • changedInput schema / properties / font_family / description
      Previous value: -"Google Fonts family name, e.g. \"Anton\". Default \"Anton\"."New value: +"Google Fonts family name, e.g. \"Anton\". Defaults to \"Hanken Grotesk\"."
  4. 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: -[
      -  "projectId"
      -]New value: +[
      +  "projectId",
      +  "anonymousToken"
      +]
  5. First observed

TDQS

A4.4/5.0
Behavior5/5

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

Even though annotations already declare readOnlyHint=false and destructiveHint=false, the description adds substantial behavioral context beyond them: the returned values (layer id, element id, text_box, fits, and an overflow warning naming a fitting text_size), the block/keyframe sampling semantics, curve clamping (±135, single-line only), and the caveat that decorations are not rendered on curved text. That is rich disclosure for a mutating tool.

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 purpose is front-loaded in the first clause and the densest material (autofit modes, block semantics, return values) comes later, so an agent can stop early. It is a long, single-paragraph block and repeats a few schema details, which keeps it just below the top score, but for a 23-parameter tool most sentences carry real information.

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 complexity (23 params, nested objects, enums) and the presence of an output schema, the description covers what it must: purpose, defaults, the block/always-present decision, autofit trade-offs, curve behavior, and even a summary of the return payload. Nothing an agent needs in order to call this correctly is missing.

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 description coverage is 100%, so the baseline is 3. The description largely restates what the schema already documents (defaults for x/y/width/height/font_family, the outline and shadow params, the derivation rule for text_size) rather than adding syntax or format detail the schema lacks. It does not materially compensate for anything, so the baseline stands.

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 opening sentence gives a specific verb+resource ('Create a new text layer') and immediately characterizes what kind of object it produces ('a first-class leaf that animates, groups, and z-orders exactly like an image or shape'). This cleanly separates it from the other add_* leaf tools such as add_image_layer and add_shape, so an agent can identify it 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 Guidelines4/5

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

The description gives genuine context cues: it says the default (no `block`) is 'what an agent-placed watermark / lower-third almost always wants' and enumerates when each `text_autofit` mode is appropriate. It does not, however, explicitly route the agent against alternatives like add_caption_track or set_layer_text, so it stops just short of the 5 anchor.

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