Skip to main content
Glama

set_variable_value

Sets a variable's value for a specific mode in Figma. Accepts raw values for colors, floats, strings, booleans, or a variable alias.

Instructions

Set a variable's value for a specific mode.

Thin wrapper over Figma's variable.setValueForMode(modeId, value). Call once per mode. Value is a raw value (COLOR/FLOAT/STRING/BOOLEAN) OR an alias object {type: "VARIABLE_ALIAS", id: "VariableID:x:y"}. Hex strings are accepted for COLOR and normalized to {r,g,b,a} in 0-1 range.

Examples: set_variable_value({variable: "VariableID:1:5", mode: "1:0", value: "#FFFFFF"}) set_variable_value({variable: "VariableID:1:5", mode: "1:1", value: {r: 0.1, g: 0.1, b: 0.1, a: 1}}) set_variable_value({variable: "VariableID:1:6", mode: "1:0", value: 16}) set_variable_value({variable: "VariableID:1:7", mode: "1:0", value: {type: "VARIABLE_ALIAS", id: "VariableID:1:9"}})

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
variableYesVariableID to set
modeYesMode id from the variable's collection (e.g. "1:0")
valueYesRaw value (COLOR/FLOAT/STRING/BOOLEAN) or {type: "VARIABLE_ALIAS", id}
Behavior4/5

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

With no annotations, the description carries full burden. It explains the thin wrapper nature, acceptable value types (raw values or alias objects), and hex color normalization. The 'Call once per mode' constraint is noted. This is good but could mention side effects or restrictions.

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 concise, front-loading the purpose, then detailing behavior, and finally providing clear examples. Every sentence adds value with no filler.

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?

The description covers the tool's behavior, parameter details, and constraints (call once per mode). No output schema exists, but for a setter tool, this is adequate. Could mention return value or errors.

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 100%, so baseline is 3. The description adds significant meaning beyond schema: it explains the value parameter can be a raw value or alias object, hex normalization, and provides examples. This extra context raises the score.

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 clearly states the tool's purpose: 'Set a variable's value for a specific mode.' The phrase 'Call once per mode' and the mention of being a thin wrapper over Figma's API help distinguish it from other variable-related tools (e.g., set_variable_mode, create_variable).

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 description implies usage for a single mode but does not explicitly compare with sibling tools like bind_variable or set_variable_mode. No direct guidance on when to use this tool versus alternatives is provided.

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/musepy/genable'

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