Skip to main content
Glama

Find and replace text

figma_find_replace_text
Idempotent

Find and replace across text: TEXT nodes and, on a board, stickies, shapes, connector labels and table cells (an item names the node, plus cell "row,column"); code blocks with includeCode. Other styled runs in a text are kept.

Instructions

Find and replace across text: TEXT nodes and, on a board, stickies, shapes, connector labels and table cells (an item names the node, plus cell "row,column"); code blocks with includeCode. Other styled runs in a text are kept. Scope it to the page (default), the selection, or a subtree by nodeId. Returns per-item results: items: [{ id, ok, error? }] — one node failing does not fail the call. Editors: Design; unverified: FigJam, Slides.

Input Schema

NameRequiredDescriptionDefault
findYes
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.
regexNoTreat `find` as a regular expression. Default false.
scopeNoDefault "page".
nodeIdNoSubtree root when scope is "subtree".
replaceYesThe new text; "" deletes each match.
sessionNoOptional sessionId or file name, to pick a Figma file when more than one is connected.
includeCodeNoAlso replace inside code blocks' code. Default false.
caseSensitiveNoDefault true.
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.

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.1/5.0
Behavior4/5

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

Annotations already cover readOnly=false, idempotent=true, destructive=false; the description adds real value beyond them by disclosing partial-failure semantics ('one node failing does not fail the call'), the per-item result shape, and that non-matching styled runs are preserved. It also warns about unverified editor support, though it doesn't discuss undo/reversibility or the STALE-refusal flow (that lives in 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?

Front-loaded with the core action and node coverage, then scope, then return shape, then editor caveat — a logical ordering. It is dense and slightly run-on in the first sentence, but no sentence is wasted.

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?

With 10 parameters and no output schema, the description compensates by explaining the return shape (`items: [{ id, ok, error? }]`) and partial-failure behavior. Editor-platform caveats are included; only minor things like undo/recovery expectations are left implicit.

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 90%, so the schema already documents force/regex/scope/includeCode/caseSensitive/idempotencyKey. The description only marginally extends this, notably the table-cell item format `cell` "row,column" and confirmation that scope options are page/selection/subtree. Baseline 3 is appropriate.

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+resource (find and replace across text) with explicit coverage of which node kinds are affected — TEXT nodes, stickies, shapes, connector labels, table cells, code blocks. It is clearly distinguishable from siblings like figma_set_text (single-node text set) and figma_batch_rename_nodes (names, not content).

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 tells the agent how to bound the search (page default, selection, or subtree by nodeId) and flags editor support ('Editors: Design; unverified: FigJam, Slides'). It stops short of explicitly naming an alternative tool or stating when *not* to use it (e.g. vs. figma_set_text for single-node replacement).

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