Skip to main content
Glama
figma-mcp-v2

figma-mcp-v2

by LukasAnda

Export design tokens (W3C DTCG)

figma_export_tokens
Idempotent

Exports Figma variables as W3C DTCG token files per collection and mode, plus a resolver for switching themes, enabling Style Dictionary to generate CSS, Swift, or Kotlin.

Instructions

Exports the file's variables as W3C Design Tokens (DTCG format 2025.10): one .tokens.json file per collection and mode, plus a .resolver.json whose modifiers switch modes (light/dark, brands, sizes). Colors become srgb color objects, spacing-like numbers become px dimensions, aliases become {group.token} references, and Figma scopes/code syntax go to $extensions. Feed the files to Style Dictionary or another DTCG tool to generate CSS, Swift or Kotlin. Works on any plan through the web source or the plugin.

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": {
      "url": "<url>"
    },
    "name": "figma_export_tokens"
  }
}

Input Schema

NameRequiredDescriptionDefault
dirNoOutput folder (created if missing)design-tokens
urlYesFigma link, e.g. https://www.figma.com/design/<fileKey>/<name>?node-id=12-345 (right-click a layer > Copy link to selection). A bare file key also works.
nameNoDesign system name for the resolver file (default: the file name)
sourceNoWhere to read from. auto (default): Figma's viewer protocol (no token, no Dev Mode), then the REST API if FIGMA_TOKEN is set, then the plugin. web/rest/plugin force one.auto
theme_collectionsNoCollections that are alternatives of each other, e.g. ["Tokens", "Tokens Dark"] on plans with one mode per collection; they become contexts of one "theme" modifier

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.1

TDQS

A3.9/5.0
Behavior4/5

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

Annotations declare readOnlyHint=false and idempotentHint=true, and the description is consistent: it writes files to an output folder. It adds useful behavior beyond annotations — no token or Dev Mode required via the web source, plan-independence, and the format version emitted. It does not mention overwrite behavior when the output folder already has files, which is the main remaining gap for a write-to-disk tool.

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-loaded with what is produced, then the format mapping, then downstream use, then plan compatibility — a sensible order. The mapping list is dense but each item tells the agent something about the export contract; no sentence is pure filler, though the format version and downstream sentence could be trimmed.

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 carries the return-value burden well by naming every emitted artifact and its internal structure. For a file-writing tool with 5 parameters it is nearly complete; only file collision/overwrite semantics and error behavior when a source is unavailable are left unstated.

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 each parameter (url, dir, name, source, theme_collections) is already documented, including the source fallback chain. The description adds meaning mostly about output mapping (colors to srgb, spacing to px, aliases to references, scopes to $extensions) rather than about parameter behavior, so it sits at the baseline for high-coverage schemas.

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 and resource ('Exports the file's variables as W3C Design Tokens') and names the concrete artifacts produced (.tokens.json per collection/mode plus a .resolver.json). The target format version and conversion rules let an agent know exactly what this produces versus a plain variable-read tool like figma_get_variables.

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

Usage Guidelines3/5

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

Gives downstream context ('Feed the files to Style Dictionary or another DTCG tool to generate CSS, Swift or Kotlin') and plan compatibility ('Works on any plan through the web source or the plugin'), which implies when this tool is appropriate. However, it never states when to prefer it over reading variables directly or names an alternative sibling, so the routing decision is only implied.

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