Skip to main content
Glama
Figma Canvas MCP

Figma Canvas MCP

by AmroJSawan

figma_get_variables

Extract Figma design tokens, variables, color and spacing values, and code exports for CSS, Tailwind, TypeScript, or Sass, including Light/Dark modes and filtered collections.

Instructions

Extract design tokens and variables from a Figma file with code export support (CSS, Tailwind, TypeScript, Sass). Use when user asks for: design system tokens, variables, color/spacing values, theme data, or code exports. Handles multi-mode variables (Light/Dark themes). NOT for component metadata (use figma_get_component). Supports filtering by collection/mode/name and verbosity control to prevent token exhaustion. Enterprise plan required for Variables API; automatically falls back to Styles API or console-based extraction if unavailable. TIP: For full design system extraction (tokens + components + styles combined), prefer figma_get_design_system_kit instead — it returns everything in one optimized call.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "figma_get_variables"
  }
}

Input Schema

NameRequiredDescriptionDefault
modeNoFilter variables by mode name or ID. Only returns variables that have values for this mode. Only applies when format='filtered'. Example: 'Light' or 'Dark'
pageNoPage number for paginated results (1-based). Use when response is too large (>1MB). Each page returns up to 50 variables.
enrichNoSet to true when user asks for: CSS/Sass/Tailwind exports, code examples, design tokens, usage information, dependencies, or any export format. Adds resolved values, dependency graphs, and usage analysis. Default: false
formatNoResponse format: 'summary' (~2K tokens with overview and names only), 'filtered' (apply collection/name/mode filters), 'full' (complete dataset from cache or fetch). Summary is recommended for initial exploration. Full format returns all data but may be auto-summarized if >25K tokens. Default: fullfull
fileUrlNoFigma file URL (e.g., https://figma.com/design/abc123). Auto-detected from WebSocket Desktop Bridge connection. Only required if not connected.
pageSizeNoNumber of variables per page (1-100). Default: 50. Smaller values reduce response size.
verbosityNoControls payload size: 'inventory' (names/IDs only, ~95% smaller, use with filtered), 'summary' (names/values only, ~80% smaller), 'standard' (essential properties, ~45% smaller), 'full' (everything). Default: standardstandard
collectionNoFilter variables by collection name or ID. Case-insensitive substring match. Only applies when format='filtered'. Example: 'Primitives' or 'VariableCollectionId:123'
namePatternNoFilter variables by name using regex pattern or substring. Case-insensitive. Only applies when format='filtered'. Example: 'color/brand' or '^typography'
refreshCacheNoForce refresh cache by fetching fresh data from Figma. Use when data may have changed since last fetch. Default: false (use cached data if available and fresh)
include_usageNoInclude usage in styles and components (requires enrich=true)
returnAsLinksNoReturn variables as resource_link references instead of full data. Drastically reduces payload size (100+ variables = ~20KB vs >1MB). Use with figma_get_variable_by_id to fetch specific variables. Recommended for large variable sets. Default: false
export_formatsNoWhich code formats to generate examples for. Use when user mentions specific formats like 'CSS', 'Tailwind', 'SCSS', 'TypeScript', etc. Automatically enables enrichment.
resolveAliasesNoAutomatically resolve variable aliases to their final values (hex colors, numbers, etc.). When true, each variable will include a 'resolvedValuesByMode' field with the actual values instead of just alias references. Useful for getting color hex values without manual resolution. Default: false.
include_exportsNoInclude export format examples (requires enrich=true)
includePublishedNoInclude published variables from libraries
parseFromConsoleNoParse variables from console logs after user has executed the snippet. This is STEP 2 of the two-call workflow. Set to true ONLY after: (1) you received a console snippet from the first call, (2) instructed the user to run it in Figma's PLUGIN console (Plugins → Development → Open Console or existing plugin), (3) user confirmed they ran the snippet and saw '✅ Variables data captured!' message. Default: false. Never set to true on the first call.
useConsoleFallbackNoEnable automatic fallback to console-based extraction when REST API returns 403 (Figma Enterprise plan required). When enabled, provides a JavaScript snippet that users run in Figma's plugin console. This is STEP 1 of a two-call workflow. After receiving the snippet, instruct the user to run it, then call this tool again with parseFromConsole=true. Default: true. Set to false only to disable the fallback entirely.
include_dependenciesNoInclude variable dependency graph (requires enrich=true)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.17.3

TDQS

A4.3/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and discloses important traits: Enterprise plan requirement, automatic fallback to Styles API or console-based extraction, multi-mode handling, and verbosity controls to prevent token exhaustion. It is strong, though it does not cover return shape, pagination behavior, or the exact two-call console workflow beyond the fallback note.

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?

The definition is front-loaded with purpose, triggers, exclusions, and alternatives, and every sentence contributes useful selection or operational context. It is appropriately sized for a complex 19-parameter tool, though a few phrases such as the filtering/verbosity summary repeat what the schema already states.

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?

Given the tool's complexity, no annotations, and no output schema, the description is largely complete for selection and invocation: it covers purpose, alternatives, plan requirements, fallback behavior, and code-export intent. It could more explicitly describe what a successful extraction returns and how pagination interacts with the various formats.

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 the input schema already documents each of the 19 parameters in detail. The description only briefly restates that filtering by collection/mode/name and verbosity controls exist, adding little semantic meaning beyond the schema.

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 names a specific verb and resource ('Extract design tokens and variables from a Figma file') and immediately distinguishes the tool from siblings: 'NOT for component metadata (use figma_get_component)' and a TIP preferring figma_get_design_system_kit for full design system extraction.

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 explicit when-to-use triggers ('design system tokens, variables, color/spacing values, theme data, or code exports'), an explicit exclusion with an alternative ('component metadata (use figma_get_component)'), and a broader alternative for combined extraction (figma_get_design_system_kit).

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

Deploy Server

Other Tools