Skip to main content
Glama
LeoGCode

figma-reader-mcp

by LeoGCode

figma_get_variables

Extract design tokens from Figma files, including collections, modes, and resolved aliases. Output as JSON, CSS custom properties, or W3C DTCG format.

Instructions

Design variables (tokens) with collections, modes, per-mode values and resolved aliases. Works on any plan (no Enterprise REST API). Formats: json (default), css (custom properties, extra modes as [data-collection=mode]), dtcg (W3C design tokens). A file that defines none answers empty in that format; figma_token_usage derives tokens from the raw values instead, and figma_get_styles reads the styles.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fileYesPath to a local .fig file, or a Figma file key / figma.com/design/... URL. A node-id in the URL is used when this tool takes node_id and it is omitted; a tool that answers about the whole file ignores it. A key or URL uses a local '<name> [<key>].fig' from FIGMA_FILES_DIRS when one exists, otherwise exports through the browser.
formatNo
refreshNoSkip local/cached copies and export the live file through the browser. Has no effect when file is a path to a .fig: that file is read as it is on disk and the result carries refreshIgnored; pass the key or URL to export the live file instead.
out_fileNoAlso write the result to this path
collectionNoOnly this collection name; a name no collection in the file has is an error listing the ones it has
css_prefixNo
include_remoteNoInclude library variables copied into the file (default true)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.9/5.0
Behavior5/5

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

Beyond the sparse annotations (readOnlyHint false, openWorldHint true), the description discloses meaningful behavior: supported output formats and their semantics, the empty-result behavior, and the distinction from sibling tools. It also clarifies via refresh semantics that file paths are read as-is while keys/URLs may require browser export, which is useful behavioral context.

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 deliver the core purpose, format semantics, plan availability, and sibling differentiation with no filler. Every sentence earns its place, and the most decision-relevant information is front-loaded.

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 7-parameter tool with no output schema, the description covers the key behavioral decisions: how to interpret output, how to pick among formats, what happens when no variables exist, and which sibling to choose instead. Combined with the schema's parameter descriptions, this is sufficient for correct 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?

With 71% schema coverage, the schema already documents most parameters. The description adds value by explaining the format enum (json default, css custom properties with extra modes, dtcg W3C design tokens), which maps directly to the format parameter, and by explaining which sibling tools cover alternative extraction approaches.

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 states the resource ('Design variables (tokens)') and what the tool provides: collections, modes, per-mode values, and resolved aliases. It also explicitly contrasts itself with figma_token_usage and figma_get_styles, so an agent can distinguish it from siblings without opening schemas.

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?

It gives clear selection guidance: use this for variables/tokens, figma_token_usage for deriving tokens from raw values, and figma_get_styles for styles. It also clarifies plan availability ('Works on any plan') and that a file with no variables answers empty in the selected format.

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