Skip to main content
Glama

create_variables

Creates or updates variables in a Figma collection, including per-mode values and aliases, so designs can reuse consistent color, number, string, and boolean tokens.

Instructions

Create or update variables in a collection. values map mode name -> value: COLOR '#hex', FLOAT number, STRING string, BOOLEAN bool, or {"alias":"other/variable name"} (looked up in the same collection first; add "collection" to point elsewhere). A single value (not a map) applies to all modes. Existing variables with the same name are updated.

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": "<collection>",
      "variables": "<variables>"
    },
    "name": "create_variables"
  }
}

Input Schema

NameRequiredDescriptionDefault
fileNoTarget file (fileKey, id or name). Defaults to the most recently active file.
variablesYes
collectionYesCollection name or id

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior4/5

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

With no annotations, the description carries the burden and does well on the risky parts: it discloses that matching names are silently updated rather than created, and documents alias resolution order (same collection first, 'collection' key to redirect). It omits permissions requirements, batching/atomicity behavior on partial failure, and any statement about what is returned.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

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

Three dense sentences, front-loaded with the operation, then the value grammar, then the upsert rule. The parentheticals about alias lookup scope and single-value shorthand each carry distinct, non-redundant information.

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 a mutation tool with no annotations and no output schema, the definition covers value format and upsert semantics but leaves real gaps: whether the target collection must already exist, what is returned on success, how `scopes` interacts with value assignment, and whether omitted fields are preserved when updating an existing variable.

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 67%, and the description compensates specifically for the weakest documented parameter: it explains the per-type value encoding (hex for COLOR, number for FLOAT, bool for BOOLEAN, alias object shape) and the 'single value applies to all modes' shorthand, which the schema's bare 'mode name -> value' does not convey. It adds nothing about `scopes` or `file`, leaving those to the schema.

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?

The description opens with a specific verb plus resource: 'Create or update variables in a collection.' The upsert framing and the mode/value model make the operation distinguishable from read-side siblings like get_variables or list_library_variables, though no sibling is named explicitly.

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?

Usage is implied rather than stated: 'Existing variables with the same name are updated' tells the agent this acts as an upsert, which is useful context for choosing it over a pure create path. There is no explicit when-to-use / when-not-to-use guidance, and no mention of how this relates to create_variable_collection or bind_variable.

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