Skip to main content
Glama

get_variable_defs

Retrieve design token variable definitions for a Figma node or current selection, resolving colors, fonts, sizes, and spacing for the node's mode.

Instructions

Get variable definitions for a given node id. E.g. {'icon/default/secondary': #949494}. Variables and styles are reusable values applied to colours, fonts, sizes and spacings. Values resolve for the node's own mode. Read-only; with no nodeId it uses the selection. Use it for design tokens, and get_design_context for the layout. Without the plugin, a saved snapshot gives the raw values only, without names.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nodeIdNoThe ID of the node, eg. "123:456" or "123-456" (instance ids like "I1:2;3:4" work too). Omit it to use the current selection in Figma.
fileKeyNoThe key of the Figma file. Accepted for compatibility; the file open in Figma Desktop is always used.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.5.1

TDQS

A4.6/5.0
Behavior5/5

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

No annotations exist, so the description carries the whole burden, and it does so well: it declares the operation read-only, discloses the no-nodeId default, explains that values resolve against the node's own mode, and warns that without the plugin a saved snapshot yields raw values without names. These are non-obvious behaviors an agent could not infer from the schema.

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?

Front-loads the core purpose and the example, then packs routing and caveats into a few tight sentences. The clause defining variables and styles is useful background but is the least load-bearing sentence; otherwise there is no waste.

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?

With two optional params, no output schema, and no annotations, the description supplies everything needed: what comes back (example value shape), how the node is chosen, how values are resolved, and what changes when the plugin is unavailable. Nothing essential is missing.

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 description coverage is 100%, so both parameters are already documented in the schema, including the omit-to-use-selection behavior and the fileKey compatibility note. The description adds only the mode-resolution context for the returned values, not node syntax or fileKey semantics. Baseline 3 is warranted.

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?

States a specific verb+resource ('Get variable definitions for a given node id') and grounds it with a concrete example value. It also pre-empts confusion with the get_design_context sibling by stating 'Use it for design tokens, and get_design_context for the layout.' The scope (resolvable design tokens attached to a node) is unambiguous.

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?

Explicitly names when to use it ('design tokens') and names the alternative (get_design_context for layout), plus states the fallback when no nodeId is supplied ('with no nodeId it uses the selection'). It also flags the degradation path when the plugin is absent, which tells the agent when the output can and cannot be trusted for names.

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