Skip to main content
Glama

Create variable

figma_create_variable
Idempotent

Creates one Figma design variable (token) in a collection with name, type, value, scopes, and code syntax; duplicate names are refused.

Instructions

One design token. value is a string for every type: "#1a2b3c" for COLOR, "16" for FLOAT, text for STRING, "true"/"false" for BOOLEAN, or "alias:" of the same type. Set scopes (which pickers offer it; [] for a primitive only aliased) and a WEB codeSyntax on every token. A name the collection already has is refused. For a whole token set in one call use figma_create_variables. Bind one to nodes with figma_bind_variable_to_node; extra modes (figma_add_variable_mode) need a paid plan. Editors: Design; unverified: FigJam, Slides.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes
typeYes
valueYesThe value for the declared type: "#1a2b3c" for COLOR, "16" for FLOAT, "Inter" for STRING, "true" for BOOLEAN.
modeIdNoMode id or name. Defaults to the collection's first mode.
scopesNoWhich property pickers offer it. [] hides a primitive that is only aliased; semantic tokens name their fields, e.g. ["FRAME_FILL","SHAPE_FILL"] or ["GAP"]. Checked against the type; ALL_SCOPES stands alone. Default (omitted): Figma's ALL_SCOPES.
sessionNoOptional sessionId or file name, to pick a Figma file when more than one is connected.
codeSyntaxNoThe name in code per platform, e.g. { "WEB": "var(--color-bg-brand)" }. "" removes that platform.
descriptionNo
collectionIdYes
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.
hiddenFromPublishingNoHide it when the file is published as a library.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.1

TDQS

A4.7/5.0
Behavior5/5

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

Annotations declare the mutation/idempotency profile, and the description goes beyond them: duplicate names are refused, scopes are validated against the type with ALL_SCOPES standing alone, empty scopes hides a primitive, and mode manipulation requires a paid plan. These are runtime behaviors an agent cannot infer from readOnlyHint/idempotentHint.

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 value encoding, then alternatives and constraints. Dense but every clause carries load. The single-block packing of value formats, scopes, aliasing, and editor support makes it slightly heavy to scan compared to cleanly separated lines.

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 an 11-param mutation with nested objects and no output schema, the description covers the high-risk semantics (duplicate refusal, type/scope validation, alias format, plan gating). It stops short of describing what is returned on success, but with no output schema that gap is minor and largely covered by the idempotencyKey retry contract.

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 64% and the description fills key gaps: per-type string encoding for `value`, the 'alias:<name or id>' reference syntax, and intended usage of `scopes` with concrete examples (["FRAME_FILL","SHAPE_FILL"], ["GAP"]). It adds meaning beyond the schema, though it does not touch modeId, idempotencyKey, or session, which the schema already documents.

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?

Opens with a precise verb+resource framing ('One design token') and immediately delimits the scope: creates exactly one variable. It names the batch sibling figma_create_variables and the binding sibling figma_bind_variable_to_node, so an agent can separate it from near-neighbors without reading 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 rules: 'For a whole token set in one call use figma_create_variables', 'Bind one to nodes with figma_bind_variable_to_node', and the paid-plan constraint for 'extra modes (figma_add_variable_mode)'. It also states editor coverage (Design verified; FigJam/Slides unverified), which is actionable context for when this call is valid.

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