Skip to main content
Glama

Set variable value

figma_set_variable_value
Idempotent

Set a variable's value in one mode. value is a string: "#1a2b3c" for COLOR, "16" for FLOAT, text for STRING, "true"/"false" for BOOLEAN, or "alias:color/brand" to point at another variable of the same type.

Instructions

Set a variable's value in one mode. value is a string: "#1a2b3c" for COLOR, "16" for FLOAT, text for STRING, "true"/"false" for BOOLEAN, or "alias:color/brand" to point at another variable of the same type. modeId takes a mode id or name and defaults to the collection's first mode. 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.
valueYesThe value for the declared type: "#1a2b3c" for COLOR, "16" for FLOAT, "Inter" for STRING, "true" for BOOLEAN.
modeIdNo
sessionNoOptional sessionId or file name, to pick a Figma file when more than one is connected.
variableIdNoe.g. "VariableID:1:2".
variableNameNoOr its full name, e.g. "color/bg/default".
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

A3.6/5.0
Behavior4/5

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

Annotations already declare idempotent=true, destructive=false, and readOnly=false, so the safety profile is covered. The description adds valuable beyond-annotation context: modeId defaults to the collection's first mode, and editor support is scoped (Design confirmed, FigJam/Slides unverified). The STALE/overwrite behavior lives only in the schema, not the description, 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.

Conciseness4/5

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

Three dense sentences, front-loaded with the core action and then the value-format and mode-default details. No filler; every clause carries information, though the type examples are slightly packed.

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 mutation tool with no output schema but strong annotations, the description covers the key call semantics (value encoding, mode default, editor availability). It is nearly complete; only return/response behavior and error/staleness handling are absent, and those are partly carried by the schema.

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 high (86%), so the baseline is 3, but the description adds real value: it spells out the type-dependent value encodings (hex for COLOR, numeric for FLOAT, alias syntax) and clarifies that modeId accepts an id or a name with a default. This compensates for the otherwise-undocumented modeId property.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb ('Set') and resource ('a variable's value') with explicit scope ('in one mode'), which distinguishes it from sibling figma_set_variable_mode or figma_create_variable. It does not explicitly rule out figma_set_variable_properties, but the intent remains clear.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

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

The description explains value encoding but gives no when/when-not guidance and names no siblings or alternatives (e.g., binding a variable to a node via figma_bind_variable_to_node). It only implies usage rather than directing it.

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