Skip to main content
Glama

Extract Design Tokens

extract_tokens
Read-onlyIdempotent

Extract design tokens from a Figma file and convert them to W3C, Style Dictionary, or raw formats for use in design systems and code.

Instructions

Extract design tokens (variables) from a Figma file and convert to standard formats.

Fetches all Figma Variables from the specified file and converts them to the requested format. Supports W3C Design Token Community Group format, Style Dictionary input format, or raw Figma API response.

Args:

  • figma_file_key (string): The Figma file key from the URL

  • collection_names (string[], optional): Filter to specific variable collections

  • output_format ('w3c' | 'style-dictionary' | 'raw'): Output format (default: 'w3c')

Returns: JSON with token data and summary statistics including counts by type and collection.

Examples:

  • "Extract all design tokens from our Figma file" → extract_tokens with just figma_file_key

  • "Get only color tokens" → extract_tokens with collection_names: ["Colors"]

  • "Export tokens for Style Dictionary pipeline" → extract_tokens with output_format: "style-dictionary"

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": {
      "figma_file_key": "<figma_file_key>"
    },
    "name": "extract_tokens"
  }
}

Input Schema

NameRequiredDescriptionDefault
output_formatNoOutput format: 'w3c' (W3C Design Token format), 'style-dictionary' (SD input format), or 'raw' (Figma API response)w3c
figma_file_keyYesThe Figma file key (from the URL: figma.com/design/{THIS_PART}/...)
collection_namesNoOptional list of variable collection names to include. Omit to include all.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.1

TDQS

A3.6/5.0
Behavior3/5

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

Annotations already declare readOnlyHint, idempotentHint and destructiveHint=false, so safety is well covered by structured data. The description adds scope ('Fetches all Figma Variables') and the return shape ('JSON with token data and summary statistics'), but says nothing about Figma auth requirements, rate limits, or behavior with very large files. With annotations carrying the safety profile, this is a modest addition.

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 a one-line purpose followed by organized Fetches/Args/Returns/Examples structure, which is easy to scan. However, the Args section almost verbatim duplicates the input schema, which is redundant content that does not earn its place.

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?

There is no output schema, and the description compensates by describing the return value as JSON token data plus summary statistics. Combined with the format options and examples, an agent has enough to call it correctly; only external concerns like authentication and limits are absent.

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 schema already documents all three parameters including the format enum and the collection filter. The description largely restates them; the only real addition is the example showing that collection_names maps to conceptual groups like 'Colors', which is marginal value on top of the schema.

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 ('Extract design tokens (variables) from a Figma file') plus the conversion step, which is genuinely informative. It does not, however, distinguish itself from the sibling extract_styles, which an agent would need to tell apart from token/variable extraction.

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?

The Examples section maps three concrete user intents onto specific parameter combinations, which gives clear guidance on how to call it. There is no explicit when-not guidance or named alternative (e.g., extract_styles), so exclusions are left to inference.

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