Skip to main content
Glama

Get variable definitions

figma_local_get_variable_defs
Read-only

Retrieves the variables and styles applied to a Figma node and its children, returning mapped names and values for colors, sizes, spacing, and fonts.

Instructions

Get the variables and styles used by a node and its children, e.g. {'icon/default/secondary': '#949494'}. Variables are reusable values for colors, sizes, spacing and fonts. Extract nodeId from the URL (node-id=1-2 -> 1:2); do not pass an empty or guessed nodeId. Variable names resolve through the companion plugin when it is running in the file, or through the REST variables API on Enterprise plans. For branch URLs use the branchKey as the fileKey.

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": {
      "fileKey": "<fileKey>",
      "nodeId": "<nodeId>"
    },
    "name": "figma_local_get_variable_defs"
  }
}

Input Schema

NameRequiredDescriptionDefault
nodeIdYesThe ID of the node in the Figma document, eg. "123:456" or "123-456". Extract it from the URL's node-id query parameter. Do not pass an empty or guessed nodeId.
fileKeyYesThe key of the Figma file to use. If a URL is provided, extract the file key from it: for https://figma.com/design/:fileKey/:fileName?node-id=1-2 the fileKey is `:fileKey`. For https://figma.com/design/:fileKey/branch/:branchKey/:fileName use the branchKey. A full URL is also accepted.
clientLanguagesNoA comma separated list of programming languages used by the client in the current context, e.g. `javascript`, `html,css,typescript`. If you do not know, list `unknown`.
clientFrameworksNoA comma separated list of frameworks used by the client in the current context, e.g. `react`, `vue`, `django`. If you do not know, list `unknown`.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and openWorldHint=true, so the safety profile is covered. The description adds genuinely non-obvious runtime behavior: name resolution depends on either the companion plugin running in the file or the REST variables API on Enterprise plans, which signals a real possibility of degraded or failed resolution. It does not describe the shape of the success response beyond one example entry or what error surfaces when neither resolution path is available.

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?

Four compact sentences that front-load what is returned and its subtree scope, then move to invocation mechanics and resolution paths. The URL-extraction sentences partially duplicate the schema, but they are short and among the highest-value tokens for avoiding bad calls.

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?

With no output schema, the description supplies an inline example of the return format, which is the most important missing piece. Combined with the plugin/Enterprise resolution caveat and the guidance that child nodes are included, an agent has enough to call it correctly. The remaining gap is what happens on failure when neither resolution path is available.

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 required parameters (fileKey, nodeId) are already fully documented in the schema, and the description's nodeId/fileKey extraction advice largely restates that text. The two optional client-context parameters are never mentioned in the description. It adds no new semantics beyond the schema, so the baseline 3 applies.

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?

States a specific verb and resource — 'get the variables and styles used by a node and its children' — and anchors it with a concrete sample output mapping a token name to a hex value. That makes the retrieval target unmistakable. It stops short of contrasting itself with siblings like get_metadata or get_design_context, so an agent must infer which sibling returns which slice of design data.

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?

Gives actionable pre-call guidance: extract nodeId from the URL (node-id=1-2 -> 1:2), never pass an empty or guessed nodeId, and use the branchKey as fileKey for branch URLs. These are the exact mistakes an agent would otherwise make. There is no explicit statement of when to prefer a sibling tool instead, so it falls short of full when/when-not guidance.

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