Skip to main content
Glama

set_text_range

Apply inline rich text styling to specific character ranges in an existing Figma TEXT node, including bold words, links, colors, lists, or font size changes.

Instructions

Style character ranges of an existing TEXT node — the write-side mirror of a read segment, for inline rich text (a link inside a sentence, a bold word, a coloured span, a bulleted list, a smaller /mo after a price). Each range gives start/end (char offsets into the node's characters) plus any subset of run properties: fontName / fontSize / fills / textDecoration / textCase / lineHeight / letterSpacing / hyperlink / listOptions / indentation, and design-system bindings textStyleId / fillStyleId / boundVariables. Ranges apply in order (a later range overrides an earlier one on overlap). Fonts are loaded automatically. Set the whole node first with create_text / set_text; use set_text_properties for node-level typography & overflow. Returns { ok, nodeId }.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nodeIdYesTEXT node id whose ranges to style
rangesYesCharacter ranges + the run properties to apply to each

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.6.0
    • removedInput schema / properties / ranges / items / properties / boundVariables / additionalProperties / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedInput schema / properties / ranges / items / properties / boundVariables / additionalProperties / type
      Added value: +[
      +  "string",
      +  "null"
      +]
  2. Changed1 schema field changedv0.1.3
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
  3. Addedv0.1.1

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already flag this as a non-read-only but non-destructive write. The description adds real behavioral context beyond them: ranges apply in order with later-overrides-earlier on overlap, fonts are loaded automatically, and it returns { ok, nodeId }. Useful traits an agent can't infer from annotations alone.

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 and scope are front-loaded, and the middle sentence is a dense but information-rich enumeration. The parenthetical examples ('a smaller /mo after a price') help without being filler, though the description is on the longer side.

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?

With no output schema, the description supplies the return shape ({ ok, nodeId }), covers the ordering semantics, prerequisites, and sibling routing. An agent has everything needed to invoke it correctly.

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 start/end and every run property are already documented in the schema. The description's enumeration of properties and the 'start/end char offsets' note restate the schema without adding new meaning, so the baseline 3 applies.

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?

Specific verb (style/set) and resource (character ranges of a TEXT node), with a crisp one-line conceptual framing ('write-side mirror of a read segment'). It explicitly distinguishes itself from set_text_properties (node-level) and points at create_text/set_text for whole-node setup.

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?

States the prerequisite sequencing ('Set the whole node first with create_text / set_text') and names the alternative for a different scope ('use set_text_properties for node-level typography & overflow'). This is explicit when-to-use-this-vs-that routing.

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

Deploy Server

Other Tools