Skip to main content
Glama
Figma Local Bridge

Figma Local Bridge

by Miart

figma_replace_repeated_with_component

Replaces repeated identical Figma nodes with instances of one master component after proving equivalence, with dry-run validation and transactional rollback on failure.

Instructions

Replace a repeated group of identical nodes with instances of one master component, in a single transactional call. Refuses to act unless every target is provably equivalent (COUNT_MISMATCH / TARGETS_NOT_EQUIVALENT / TARGETS_NOT_PROVABLE all abort with mutated:false). Verifies placement afterwards and rolls back on failure. Run with dryRun:true first.

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": {
      "sourceId": "<sourceId>",
      "componentKey": "<componentKey>"
    },
    "name": "figma_replace_repeated_with_component"
  }
}

Input Schema

NameRequiredDescriptionDefault
matchNoSelector for the cohort. Exact name+type only — no fuzzy matching.
dryRunNoPreview: resolves and validates, mutates nothing
policyNostrict
fileKeyNoWhich connected Figma file to use: its fileKey (figma_whoami) or, when omitted, the only connected file. Required once more than one file is connected; figma_ping lists them.
preserveNo
sourceIdYesCanonical node; it is CLONED into a master, never mutated
componentKeyYesIdempotency key; an existing master with this key is reused
componentNameNo
expectedCountNoAbort if the selector matches a different number

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.36.0

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations provided, the description does the heavy lifting well: it discloses atomicity, the abort semantics (mutated:false on COUNT_MISMATCH / TARGETS_NOT_EQUIVALENT / TARGETS_NOT_PROVABLE), post-mutation verification, and rollback on failure. It omits permission/auth requirements and does not describe the shape of a successful response, which keeps it from a 5.

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?

Four compact sentences, each carrying distinct information: capability, precondition, failure behavior, and the recommended first call. Nothing is repeated from structured fields and the dry-run advice is correctly placed last.

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 9-parameter mutating tool with nested objects, no annotations, and no output schema, the description covers the critical risk surface (refusal, rollback, dry run). It leaves the policy enum and the return payload undescribed, which a mutation tool without an output schema would ideally address.

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 coverage is 67%, so the schema documents most parameters; the description adds useful meaning by tying COUNT_MISMATCH to expectedCount and TARGETS_NOT_EQUIVALENT to the match selector, and by implying cloning of sourceId. The 'policy' enum (strict vs componentize) and componentName remain unexplained in both places, a real semantic gap for a mutation tool.

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 ('Replace a repeated group of identical nodes with instances of one master component'), which an agent can distinguish from a swap or batch-edit operation without opening the schema. The transactional framing and the equivalence precondition sharpen the scope further.

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 a clear operating recommendation ('Run with dryRun:true first') and defines the refusal conditions under which it should not proceed. It stops short of naming an alternative tool or stating when a different approach (e.g., a plain swap or batch edit) is preferable, so guidance is strong but not complete.

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