Skip to main content
Glama

Style part of a text

figma_set_text_range
Idempotent

Style part of a Figma text node by matching a word or using start/end offsets, then apply fonts, colors, links, lists, and variables.

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: 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

TableJSON Schema
NameRequiredDescriptionDefault
endNo
caseNo
linkNoA URL, or "node:<id>" for a layer in this file.
listNoNumbered or bulleted paragraphs; none removes the list.
colorNo
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. First observedv0.1.1

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=false, destructiveHint=false, idempotentHint=true, and the description does not contradict them. It adds real behavioral context beyond the annotations: 'Everything is checked before the text changes' (atomic validation), the single-colour-source constraint, and environment verification status. It stops short of describing failure modes or the returned result, but the additions are substantive.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Dense but front-loaded: scope first, then selection mechanics, then design-system binding, then the colour-source exclusivity caveat, then the sibling pointer and environment note. Every sentence carries information an agent needs; no filler.

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 24-parameter mutation tool with no output schema and only 71% schema coverage, this description supplies the critical selection semantics, variable-binding guidance, colour-source constraint and pre-write validation. The gaps (error/return behavior, a few undocumented scalar params) are minor given the annotations and sibling pointer, so it is close to but not fully complete.

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 24 parameters and 71% schema coverage, the description compensates well: it explains that paragraph spacing, paragraph indent, list and indent widen to the whole paragraphs the part touches — a non-obvious behavioral rule absent from the schema — plus the exclusivity of color/fillStyle/colorVariable and the 'node:<id>' link form. It does not cover every remaining undocumented parameter (weight, fontSize, case, decoration), so it falls short of a 5.

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?

Names a precise verb+resource ('Style part of one text node') and enumerates the concrete use cases (bold word, coloured price, underlined link, bulleted paragraph). It explicitly distinguishes itself from the sibling figma_set_text_properties, which handles whole-node properties, so an agent can route between them 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?

Gives clear context: it names the alternative tool for whole-node properties (alignment, resizing, truncation) and states the selection rule (match/occurrence vs start/end). It also flags the editor support matrix (Design; unverified: FigJam, Slides). No explicit 'when not to use' beyond the single sibling pointer, so not quite a 5.

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