Skip to main content
Glama

Style part of a text

figma_set_text_range
Idempotent

Style part of one text node (or a sticky's, shape's or connector's text) — a bold word, a coloured price, an underlined link, a bulleted paragraph.

Instructions

Style part of one text node (or a sticky's, shape's or connector's text) — a bold word, a coloured price, an underlined link, a bulleted paragraph. Pick the part with match (every occurrence, or the nth with occurrence) or with start/end character offsets. Paragraph spacing, paragraph indent, list and its indent level widen to the whole paragraphs the part touches. To tie the part to the design system, use textStyle and fillStyle (a local style's id or exact name), colorVariable (a COLOR variable), and variables per text field. One colour source per call: color, fillStyle or colorVariable. link takes a URL, or "node:" to link to a layer in this file. Everything is checked before the text changes. For whole-node properties (alignment, resizing, truncation) use figma_set_text_properties. Editors: Design; unverified: FigJam, Slides.

Input Schema

NameRequiredDescriptionDefault
endNo
caseNo
linkNoA URL, or "node:<id>" for a layer in this file.
listNoNumbered or bulleted paragraphs; none removes the list.
colorNo
forceNoOverwrite on purpose. A write to a node someone changed after you last read it is refused (STALE); read it again and resend instead. Pass true only when the person said to overwrite their edit.
matchNoThe text to style, e.g. "Pro".
startNo
indentNoList level of the lines, 0–5 (1 = a top-level item); with `list` for nested bullets.
nodeIdYes
weightNoFont weight as a number ("600") or a Figma style name ("Semi Bold" — Inter uses spaces, not "SemiBold").
sessionNoOptional sessionId or file name, to pick a Figma file when more than one is connected.
fontSizeNo
fillStyleNoA paint style id or exact name for the text colour.
textStyleNoA text style id ("S:…") or exact name, e.g. "Body/Strong".
variablesNoBind fields of the range to variables, e.g. { "fontSize": "type/body/size" }: FLOAT for sizes and spacing, STRING for family and style, either for weight.
decorationNo
fontFamilyNoA family available in this Figma (figma_suggest_fonts lists ranked ones).
lineHeightNo"auto", px ("24"), or percent ("150%").
occurrenceNoOnly the nth match. Default: all.
colorVariableNoA COLOR variable name or id, e.g. "color/text/link".
letterSpacingNopx ("0.5") or percent ("-1%").
idempotencyKeyNoCaller-owned retry key, ≤128 chars. Re-calling with the same key never executes twice: it returns the existing result, or waits for the op still in flight. Supply your own for anything large — if the MCP client times out (rather than the bridge), only a key you chose can be used to retry safely.
paragraphIndentNopx the first line of each paragraph is offset from the left.
paragraphSpacingNoVertical px between paragraphs.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.3.0
    • addedInput schema / properties / force
      Added value: +{
      +  "description": "Overwrite on purpose. A write to a node someone changed after you last read it is refused (STALE); read it again and resend instead. Pass true only when the person said to overwrite their edit.",
      +  "type": "boolean"
      +}
  2. First observedv0.1.1

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already declare this is a non-read-only, idempotent, non-destructive write. The description adds useful behavioral context: validation happens before changes, paragraph-level properties widen to whole touched paragraphs, colour sources are mutually exclusive, and editor support is qualified. It does not fully describe stale-write handling or return behavior, but those are covered partly by the 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?

The description is front-loaded with purpose and selection mechanics, and nearly every clause carries useful information. It is dense and delivered as one long paragraph, which slightly reduces readability for a 25-parameter tool.

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 tool's complexity, annotation coverage, and rich input schema, the description supplies enough context to call it correctly: target selection, styling sources, design-system binding, link formats, validation before mutation, and the key sibling alternative. Nothing essential for correct invocation is missing.

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?

With 25 parameters and 72% schema description coverage, the schema does much of the work. The description adds meaningful semantics for the most ambiguous areas: match/occurrence vs start/end, textStyle/fillStyle/colorVariable/variables, link target syntax, and which properties widen to paragraphs.

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 description states a specific verb and resource: style part of a text node, including sticky, shape, and connector text. It gives concrete examples (bold word, coloured price, link, bulleted paragraph) and explicitly distinguishes itself from figma_set_text_properties for whole-node properties.

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?

It explains exactly how to select the target range via `match`/`occurrence` or `start`/`end`, and names the alternative tool for whole-node properties. It also states constraints such as one colour source per call and widening behavior for paragraph-level properties.

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