Skip to main content
Glama
figma-mcp-v2

figma-mcp-v2

by LukasAnda

Create variable

figma_create_variable

Creates a Figma variable in a collection with per-mode values or aliases, letting you define colors, numbers, strings, or booleans for design tokens and themes.

Instructions

Creates a variable in a collection with a value per mode, e.g. type COLOR, values {"Light":"#FFFFFF","Dark":"#111111"}, or an alias {"Light":{"alias":"Base/White"}}.

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": {
      "collection_id": "<collection_id>",
      "name": "<name>",
      "type": "<type>",
      "values": "<values>"
    },
    "name": "figma_create_variable"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlNoFigma link (or file key) of the file to edit. Needed only when the plugin is open in more than one file.
nameYesSlash-separated groups allowed, e.g. "Background/Primary"
typeYes
scopesNo
valuesYesMode name (or id) -> value
code_syntaxNoe.g. {"WEB":"var(--bg-primary)"}
descriptionNo
collection_idYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.1

TDQS

A3.5/5.0
Behavior3/5

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

Annotations already declare mutation (readOnlyHint=false), non-idempotence, and non-destructiveness, so the safety profile is covered. The description adds useful disclosure about alias syntax and per-mode value structure, but omits behavior on name collisions or non-existent modes, and never states what the call returns even though no output schema exists.

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?

A single front-loaded sentence with concrete inline examples; nothing is redundant. The clause ordering is slightly dense ('with a value per mode, e.g. type COLOR, values {...}'), but every element, including the alias example, earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For an 8-parameter nested-object mutation with no output schema, the definition covers the core creation semantics and the tricky value format but leaves return value, duplicate-handling, and the meaning of scopes/code_syntax unaddressed. Adequate to invoke, incomplete for confident use.

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?

With 50% schema coverage, the description compensates meaningfully on the hardest parameters: it demonstrates the values object shape (mode name -> literal or {"alias": "..."}) and anchors the type enum with a COLOR example. Undocumented parameters (collection_id, scopes, code_syntax beyond one example, url) remain unaddressed, keeping it below 5.

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?

Specific verb+resource: 'Creates a variable in a collection with a value per mode'. This clearly separates it from figma_set_variable_value (which modifies an existing variable) and figma_create_variable_collection (which creates the container). However, it never explicitly names or contrasts with those siblings, so the distinction is inferred rather than stated.

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

Usage Guidelines3/5

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

The phrase 'in a collection' implicitly signals the prerequisite that a collection must already exist, and the mode-keyed values example implies the design-token workflow. But there is no explicit when-to-use guidance, no statement of what to do for an existing variable (use figma_set_variable_value), and no mention of mode prerequisites.

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