Skip to main content
Glama

create_variable

Create a variable in a Figma collection with a specified type (BOOLEAN, FLOAT, STRING, COLOR). Starts empty, so set per-mode values and bind to nodes or paints later. Not for EASING/TIMING.

Instructions

Create a variable in a collection with resolvedType BOOLEAN / FLOAT / STRING / COLOR. The variable starts empty — set per-mode values with set_variable_value, then attach it with bind_variable_to_node or bind_variable_to_paint. EASING and TIMING variables cannot be created by plugins at all — Figma rejects it; they can only be made in the Figma UI. Returns { ok, variableId, name }.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesVariable name, e.g. "color/primary"
collectionIdYesVariable collection id
resolvedTypeYesVariable data type
Behavior5/5

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

Annotations only indicate readOnlyHint=false and destructiveHint=false, but the description adds valuable context beyond that: the variable starts empty, EASING/TIMING are rejected, and the return value is { ok, variableId, name }. It also differentiates this tool from related ones by explaining what it does NOT do (set values or bind).

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?

The description is three sentences: the first states the core purpose, the second explains the workflow, and the third notes a limitation and return value. Every sentence adds value and the most important information is front-loaded. No filler or unnecessary repetition.

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 create operation with no output schema, the description covers the essential behavior: what it creates, the allowed types, the initial empty state, the required follow-up actions, the unsupported types, and the return format. Considering the sibling tool landscape, it fully equips the agent to use this tool correctly within the broader workflow.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema covers 100% of parameters with descriptions, so baseline is 3. The description repeats the resolvedType enum values but does not add new meaning for each parameter beyond what the schema already provides. It does mention the types in the context of the tool's purpose, but that is not extra semantic detail.

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?

The description opens with a specific verb and resource: 'Create a variable in a collection with resolvedType BOOLEAN / FLOAT / STRING / COLOR.' This clearly identifies the tool's function and scope. It also distinguishes itself from sibling tools like set_variable_value and bind_variable_to_node by explaining the variable starts empty and requires subsequent steps.

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?

The description provides explicit usage sequencing: 'set per-mode values with set_variable_value, then attach it with bind_variable_to_node or bind_variable_to_paint.' It also gives a clear exclusion: EASING and TIMING variables cannot be created by plugins and must be made in the Figma UI. This guidance is actionable and helps the agent decide when to use this tool.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/awdr74100/figwright'

If you have feedback or need assistance with the MCP directory API, please join our Discord server