Skip to main content
Glama
Rompni

figma-rest-mcp

by Rompni

Get variable / token defs

get_variable_defs
Read-only

Retrieves Figma variable definitions (collections, modes, values) with alias resolution. Falls back to styles and inferred tokens if variables are unavailable.

Instructions

Preferred token path (REST, not official Desktop get_variable_defs). Tries local Figma variables first (Enterprise + file_variables:read), shapes { collections, modes, variables: [{ id, name, resolvedType, valuesByMode, scopes }] }, resolves aliases one level. If variables 403/empty and fallback is on (default), uses file styles + inferred subtree tokens labeled inferred: true. Pass node_id so fallback can resolve style usage and infer colors/type/radii/spacing.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fileYesFigma file key or URL (figma.com/design/... or figma.com/file/...)
modeNosummary = default mode only; trim = drop hidden; full = include hidden/descriptions. Default trim.
node_idNoOptional frame id so fallback can infer from the subtree and resolve style usage.
fallbackNoIf variables are missing/403, use styles+inferred (default true). Set false to surface the Enterprise error.
max_variablesNo
resolve_aliasesNoResolve VARIABLE_ALIAS one level (default true).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.5.0

TDQS

A4.7/5.0
Behavior5/5

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

Beyond the readOnlyHint/openWorldHint annotations, the description reveals authentication requirements (Enterprise + file_variables:read), fallback behavior using styles and inferred tokens, alias resolution depth, and the output shape. This is substantial behavioral context that helps an agent predict side effects and edge cases.

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-load the tool's role, then cover behavior, fallback, output shape, and parameter guidance. Every sentence earns its place; there is no filler or repetition of annotation data.

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 composite tool with no output schema, the description provides enough to call it correctly: primary path, auth requirement, fallback condition, inference behavior, and return shape. The remaining details are covered by the input schema, making this complete for selection and invocation.

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 83%, so most parameters are already documented. The description adds meaningful context for node_id ('so fallback can resolve style usage'), fallback ('uses file styles + inferred subtree tokens'), and alias resolution, going beyond the schema. Only max_variables is left unexplained, but its schema bounds are self-explanatory.

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?

Description states a specific purpose: retrieving variable/token definitions via REST. It explicitly differentiates from the official Desktop get_variable_defs and describes the primary path plus fallback, so an agent can distinguish this composite tool from related siblings.

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

Usage Guidelines4/5

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

The phrase 'Preferred token path (REST, not official Desktop get_variable_defs)' gives clear selection guidance. It also describes the fallback trigger ('If variables 403/empty and fallback is on'), but it does not explicitly name sibling alternatives such as get_local_variables or get_file_styles or state when to prefer them.

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