Skip to main content
Glama

draw_text

Render text with a chosen font and paint it onto a sprite layer, with options for outline, shadow, color, spacing, and antialiasing.

Instructions

Render text with a font and paint it onto a layer.

The text's bounding box is the smallest box around every painted pixel (glyphs, outline and shadow); anchor picks which of its pixels is placed at (x, y). For an even width or height the centre pixel is the one left of or above the middle. measure_text gives the box size. Without antialias every pixel gets exactly color (or outline/shadow); with it, edge pixels are partly transparent: blend=false stores them as they are, blend=true mixes them over the layer. Indexed sprites take the nearest palette colour (partly transparent edges become opaque there, so keep antialias off). Pixels off the canvas are skipped and counted in skipped_outside. Text is at most 2000 characters and 2048x2048 px. Colour emoji are not supported; characters the font lacks show its fallback glyph.

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": {
      "path": "<path>",
      "text": "<text>",
      "x": "<x>",
      "y": "<y>",
      "color": "<color>"
    },
    "name": "draw_text"
  }
}

Input Schema

NameRequiredDescriptionDefault
xYesCanvas x of the anchor point
yYesCanvas y of the anchor point
boldNoThicken the glyphs by 1 px to the right
fontNoFont name from list_fonts (family, 'Family Style' or file name, any case) or an absolute path to a .ttf/.otf/.ttc file; empty = the built-in font
pathYesSprite file. Relative paths resolve against the server root.
sizeNoFont size in pixels (FreeType pixel size)
textYesText, at most 2000 characters; '\n' starts a new line
blendNofalse: pixels get exactly this colour (transparent erases, except on a background layer, which ignores alpha); true: the colour is alpha-blended over what is there
colorYes'#RRGGBB', '#RRGGBBAA' or 'transparent'
frameNo1-based frame number
layerNoLayer name or 'group/child' path; empty = the bottom-most normal layer
anchorNoWhich pixel of the text's bounding box lands on (x, y)top_left
shadowNoColour of a drop shadow
outlineNoColour of a ring around the glyphs
antialiasNoKeep smooth, partly transparent glyph edges; false = crisp pixels
shadow_dxNoShadow offset to the right
shadow_dyNoShadow offset downwards
create_celNoAdd an empty cel when the layer has none in that frame
line_spacingNoExtra px between lines
outline_widthNoOutline thickness in pixels
letter_spacingNoExtra px between characters

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.5/5.0
Behavior5/5

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

With no annotations, the description carries the full behavioral burden and does so: it defines the bounding box, anchor placement including the even-dimension tie-break, the antialias/blend interaction, indexed-palette quantization, off-canvas pixel skipping counted in skipped_outside, hard limits (2000 chars, 2048x2048 px), and the emoji/fallback-glyph caveat.

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 action is front-loaded in sentence one and nearly every following sentence adds a distinct constraint. It is a dense single block without sub-structure, which makes the antialias/blend rules slightly harder to scan than they need to be.

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 21-parameter mutation tool with an output schema and full schema coverage, the description supplies the non-obvious rendering semantics and limits. It is silent on layer/frame targeting and create_cel behavior, though those live in the schema.

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; the description earns above that by explaining what anchor actually does geometrically and how antialias, blend, and indexed sprites interact — semantics the schema's one-line parameter blurbs do not convey.

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 names a specific verb and resource ("Render text... paint it onto a layer") and the body explicitly routes measurement to the sibling measure_text, so an agent can separate the two without opening either 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?

It gives concrete usage conditions rather than vague context: use measure_text for box size, and keep antialias off on indexed sprites because partly transparent edges become opaque there. It stops short of explicit when-not-to-use-this-tool guidance or naming alternatives for other drawing primitives.

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