Skip to main content
Glama

Create variables

figma_create_variables
Idempotent

A token set in ONE call (one undo step): primitives first, then semantic tokens that alias them, each with a value per mode, scopes and code syntax.

Instructions

A token set in ONE call (one undo step): primitives first, then semantic tokens that alias them, each with a value per mode, scopes and code syntax. Values are strings: "#1a2b3c" / "#1a2b3c80", "16", text, "true", or "alias:" — the target must exist already or come EARLIER in this call, with the same type. Everything is checked before the first variable exists, so a refusal creates nothing. ifExists decides what a name the collection already has does: "error" (default), "skip" (keep it; aliases resolve to it), or "update" (set the given values and properties). Up to 200 per call, paced so Figma stays responsive. For one variable figma_create_variable is enough; to change properties later use figma_set_variable_properties. Editors: Design; unverified: FigJam, Slides.

Input Schema

NameRequiredDescriptionDefault
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.
sessionNoOptional sessionId or file name, to pick a Figma file when more than one is connected.
ifExistsNoDefault "error".
variablesYes
collectionIdYesThe collection, from figma_get_variable_defs or figma_create_variable_collection.
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.6/5.0
Behavior4/5

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

Goes well beyond the annotations: it discloses that everything is validated before the first variable exists so a refusal creates nothing, the 200-per-call cap, pacing for Figma responsiveness, alias target ordering with type matching, and editor availability (Design; unverified FigJam/Slides). The only reason it is not a 5 is that it does not describe what the response contains on partial or refused runs, which matters for a batch 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?

Front-loads the core (token set, one call, one undo step) and every sentence carries load-bearing information. Slightly dense in the values/alias sentence, where the em-dash chains pack three constraints together, but there is no filler.

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?

For a complex batch mutation with no output schema, the description covers atomicity, validation timing, ordering dependencies, size limits, idempotent existence handling, editor support and escape hatches to sibling tools. Nothing an agent needs in order to call it correctly 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?

Schema coverage is already 83%, but the description adds real meaning: the string literal formats for values ('#1a2b3c', '16', text, 'true', 'alias:<name or id>'), the constraint that alias targets must exist earlier in the same call with the same type, and the full behavior of ifExists. It does not add anything for force, session or idempotencyKey, which the schema already covers well.

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?

States a specific verb and resource (create a whole token set / variable collection entries in one call), plus the atomicity promise (one undo step) and the primitives-then-aliases ordering. It names the sibling it is not (figma_create_variable for a single variable), so an agent can distinguish it 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 Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicit routing: 'For one variable figma_create_variable is enough; to change properties later use figma_set_variable_properties.' It also gives the decision rule for name collisions via ifExists (error/skip/update) and the ordering rule for aliases, so the when and the how are both covered.

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