Skip to main content
Glama

text

Destructive

Create a live, editable text layer or restyle one, chosen with op (create, set_content, set_font, set_color, set_alignment, set_box), with an optional fixed box that wraps the text and a fit option. create adds a layer at x / y with text, font_size in points and optional font_name, red / green / blue and alignment; it reports layer_id, name, bounds, the photo's ppi and the font size in pixels. The set_* ops change the text layer named by layer_id or layer (a non-text layer is refused). Fonts accept a family ("Inter") or a full name ("Inter Bold"), case-insensitive; a miss is refused with the closest installed names (list them with inspect what=fonts). Text is capped at 2000 characters, and a layer that would render past the size limit is refused and leaves the photo unchanged. Alignment is LEFT, CENTER, RIGHT or FULLYJUSTIFIED only. box {width, height?} (create, set_box) fixes the text box so text wraps at width; fit shrinks the size to approximately the largest size at which the wrapped text fits a box with both sides; the result then carries box and, for fit, fitted and fit_probes. Text sits at the top of the box (there is no vertical alignment). There is no undo in this session: checkpoint first when in doubt.

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": {
      "image": "<image>",
      "op": "<op>"
    },
    "name": "text"
  }
}

Input Schema

NameRequiredDescriptionDefault
xNocreate only: the layer's left edge in document pixels.
yNocreate only: the layer's top edge in document pixels.
opYescreate: a new text layer at the top of the stack with `text` at `x`/`y` (default 100,100) and `font_size` (default 24), optionally with font_name, red/green/blue and alignment. set_content: replace the text with `text`. set_font: set `font_name`, `font_size`, or both (omit font_name to resize in the current font). set_color: set red/green/blue. set_alignment: set `alignment`. set_box: put the layer in a fixed `box` (re-wrapping its text). The set_* ops act on the text layer named by `layer_id` or `layer`.
boxNocreate, set_box: a fixed text box {width, height?} in image pixels (each side 1 to 30000, area within the text-box cap: 64 MP at 8-bit, 32 MP at 16-bit, 16 MP at 32-bit). The text wraps at `width` (newlines in the text are kept) and is placed at the top of the box; there is no vertical alignment, so a taller box leaves the space below. Omit `height` and the layer grows to the wrapped text's height. The box survives later set_content / set_font / set_alignment edits. Emoji and some scripts depend on installed fonts and may render as empty boxes.
fitNocreate, set_box: with a `box` that has both width and height (at most 16 MP), shrink the text to approximately the largest size (at most font_size, or the current size for set_box) at which the wrapped text fits inside the box, searched in at most 12 trial renders. A word wider than the box counts as not fitting. The result reports `fitted`: false when even min_size overflows (the text is left at min_size).
redNoText colour red, 0-255. red, green and blue go together.
blueNoText colour blue, 0-255.
textNocreate: initial text. set_content: the new text, replacing the existing text. At most 2000 characters. For a line break, put a newline character in the string (not a backslash followed by n).
greenNoText colour green, 0-255.
imageYesImage id, as returned by open_photo.
layerNoset_*: name of the text layer to change. Ignored when layer_id is given. Not used by create.
layer_idNoset_*: id of the text layer to change (create reports it; inspect flags text layers with is_text_layer). Takes priority over `layer`. Not used by create.
min_sizeNofit only: the smallest font size to try, in pixels (default 8).
alignmentNoText alignment: LEFT, CENTER, RIGHT or FULLYJUSTIFIED (the justified-with-last-line variants are refused). In a box, alignment applies within the box width.
font_nameNoFont family ("Inter", "Open Sans") or full name ("Inter Bold"), case-insensitive. create: omit for a default sans. A name that matches nothing is refused with the closest installed names; inspect what=fonts lists them all.
font_sizeNoFont size in points, 1 to 1296, converted to pixels with the image resolution. create: initial size (default 24). set_font: new size (omit to keep the current size).

Output Schema

NameRequiredDescriptionDefault
boxNocreate / set_box with a box: the resulting box in pixels.
ppiNoThe image's resolution.
fontNo
nameNo
textNoCapped at 200 characters for reporting.
colorNo
boundsNo
fittedNofit only: false when even min_size overflows the box.
layer_idNo
alignmentNo
font_sizeNoPoints.
fit_probesNofit only: trial renders used (at most 12).
has_markupNo
fit_secondsNofit only: time the search took.
text_lengthNo
font_size_pxNoThe font size in pixels at the image resolution (the height of a line).
mindset_notesNo
text_truncatedNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • removedOutput schema / properties / editor_notes
      Removed value: -{
      -  "items": {
      -    "type": "string"
      -  },
      -  "type": "array"
      -}
    • addedOutput schema / properties / mindset_notes
      Added value: +{
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
  2. Changed1 schema field changed
    • addedOutput schema / properties / editor_notes
      Added value: +{
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
  3. Changed1 schema field changed
    • changedInput schema / properties / op / description
      Previous value: -"create: a new text layer at the top of the stack with `text` at `x`/`y` (default 100,100) and `font_size` (default 24), optionally with font_name, red/green/blue and alignment. set_content: replace the text with `text`. set_font: set `font_name` (optionally `font_size`). set_color: set red/green/blue. set_alignment: set `alignment`. set_box: put the layer in a fixed `box` (re-wrapping its text). The set_* ops act on the text layer named by `layer_id` or `layer`."New value: +"create: a new text layer at the top of the stack with `text` at `x`/`y` (default 100,100) and `font_size` (default 24), optionally with font_name, red/green/blue and alignment. set_content: replace the text with `text`. set_font: set `font_name`, `font_size`, or both (omit font_name to resize in the current font). set_color: set red/green/blue. set_alignment: set `alignment`. set_box: put the layer in a fixed `box` (re-wrapping its text). The set_* ops act on the text layer named by `layer_id` or `layer`."
  4. Added

TDQS

Score is being calculated.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources