Skip to main content
Glama
Figma Local Bridge

Figma Local Bridge

by Miart

figma_build

Creates or updates a declarative, keyed UI tree in one transaction after validating the spec, returning a dry-run plan so re-sent builds patch existing nodes instead of duplicating them.

Instructions

Create or update a declarative, keyed UI tree in ONE transaction. The spec is validated and resolved (fonts, styles, local variables, components) before anything is written; every node gets a stable key in pluginData, so re-sending the same buildId updates instead of duplicating. dryRun defaults to TRUE and returns a real plan plus a scope fingerprint. Pass dryRun:false with that fingerprint to apply. An existing root with the same buildId is patched in place; prune:true makes the tree exact by deleting keyed children the spec no longer contains. An SVG leaf is created as a frame; re-sending it updates that frame in place, and a changed svg source replaces its interior while keeping the id and key. A BOOLEAN_OPERATION is created from at least two operands in spec order (first operand is the subtract/intersect base) and can change its operation in place; its size is derived from the operands and is ignored. A PATTERN paint resolves its file-local source node id before writing and is refused when that node is missing. A SHADER paint must resolve to an available fill shader; an unimported shader is imported inside the write transaction. Refuses type changes, ambiguous component names, unknown keys, position inside auto-layout, component swaps, and unsupported node types.

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": {
      "root": "<root>"
    },
    "name": "figma_build"
  }
}

Input Schema

NameRequiredDescriptionDefault
modeNoupsert: create or update by buildId; create: refuse if it existsupsert
rootYesThe tree. FRAME, COMPONENT and BOOLEAN_OPERATION may have children; an INSTANCE uses properties/overrides.
pruneNoDelete keyed children not present in the spec, at every level. Protected nodes are skipped and reported.
dryRunNoTRUE (default): plan and validate only. FALSE: apply in one undo transaction.
planIdNoThe planId returned by figma_build; if supplied on apply, a different spec is refused before it is sent.
buildIdNoStable build scope. Defaults to root.key. Re-send the same id to update the same root.
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.
parentIdNoContainer for a new root; defaults to the current page
expectedFingerprintNoScope fingerprint from a previous dry run. Apply refuses if the document has moved since.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.36.0

TDQS

A4.3/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does so: it discloses the dry-run-by-default safety gate, the fingerprint staleness check, patch-in-place semantics for a matching buildId, prune deletion with protected-node skip, SVG interior replacement preserving id/key, boolean size derivation, PATTERN missing-source refusal, and shader import inside the write transaction. It also enumerates the refusal cases (type changes, ambiguous component names, unknown keys, position inside auto-layout, component swaps, unsupported node types), which is exactly the failure surface an agent needs before committing a write.

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 core purpose and the dry-run gate are front-loaded, and essentially every sentence carries a concrete behavior rather than filler. The weakness is formatting: it is one unbroken block of dense, sometimes run-on clauses, so an agent must parse the whole paragraph to find the apply workflow.

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 nine-parameter tool with a deeply nested recursive schema and no output schema, the description covers the write semantics, the apply lifecycle, and the refusal surface thoroughly. It stops short of describing the shape of the returned plan or how the spec is obtained in the first place, but nothing needed to invoke the tool safely is missing.

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 the schema already documents all nine parameters, which sets the baseline at 3. The description does add cross-parameter meaning the schema cannot express — buildId reuse updating rather than duplicating, the expectedFingerprint/planId guard pairing, and prune's interaction with protected nodes — but it does not add per-field guidance beyond that.

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 opening sentence gives a specific verb and resource — 'Create or update a declarative, keyed UI tree in ONE transaction' — plus the keyed/transactional model that separates it from a generic edit tool. An agent knows immediately it is dealing with a declarative, idempotent tree-write rather than an imperative per-node editor.

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 strong in-tool workflow guidance: dryRun defaults to TRUE, returns a plan and scope fingerprint, and apply requires dryRun:false with that fingerprint; mode=create refuses if the buildId exists, and prune:true makes the tree exact. What it never states is when to choose this over siblings such as figma_batch_edit or how it pairs with figma_export_build_spec, so tool selection is left to inference.

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