Skip to main content
Glama

Get design context

figma_local_get_design_context
Read-only

Retrieve a Figma node’s design context for design-to-code handoff, including reference React and Tailwind code, assets, design tokens, components, and a screenshot.

Instructions

Get design context for a Figma node — the primary tool for design-to-code workflows. Returns React + Tailwind reference code, asset download URLs, the design tokens and components used, and a screenshot of the node. The code is a reference: adapt it to the target project's components, design tokens and conventions. Use the nodeId parameter to specify a node id and the fileKey parameter to specify the file key. If given the URL https://figma.com/design/:fileKey/:fileName?node-id=1-2, the nodeId is 1:2 and the fileKey is :fileKey. If the URL does not include node-id, ask the user for a node-specific URL; do not pass an empty or guessed nodeId. For branch URLs (https://figma.com/design/:fileKey/branch/:branchKey/:fileName) 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_design_context"
  }
}

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.
forceCodeNoWhether code should always be returned, instead of just metadata when the output is too large. Only set when the user directly asks.
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`.
excludeScreenshotNoWhether to exclude the screenshot of the design from the response. Not recommended; only set when the user asks or to preserve context.
disableCodeConnectNoWhether to skip Code Connect (dev resource) lookups. Only set when the user asks.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.2/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 safety is covered; the description adds real behavioral context beyond that — the code is a reference to be adapted, asset URLs and tokens accompany it, and the tool should refuse to run without a node-specific URL. It doesn't mention auth requirements, rate limits, or what happens when the response is truncated (that is left to the forceCode schema entry).

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 purpose and return payload before the mechanical URL details, which is the right ordering. It runs a bit long because the node-id and branch-URL parsing instructions duplicate text already in the schema, but no sentence is entirely wasted.

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?

With seven parameters, no output schema, and a read-only annotation set, the description carries the burden of explaining return values — and it does so explicitly (code, asset URLs, tokens, components, screenshot). Combined with the nodeId/fileKey derivation rules and the ask-the-user fallback, an agent has everything needed to call it correctly.

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 every parameter is already documented. The description's URL-parsing walkthroughs largely restate the fileKey/nodeId schema descriptions, adding only illustrative URL forms; it says nothing about forceCode, clientLanguages, clientFrameworks, excludeScreenshot, or disableCodeConnect. Baseline 3 is appropriate.

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 ("Get design context for a Figma node") and immediately positions itself as "the primary tool for design-to-code workflows," which distinguishes it from the metadata, screenshot, and variable-defs siblings. It also enumerates the concrete payload (React + Tailwind reference code, asset URLs, tokens, components, screenshot), so an agent knows exactly what it gets back.

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 clear when-to-use framing (design-to-code workflows, primary tool) plus concrete preconditions: how to derive nodeId/fileKey from a URL, and an explicit negative instruction to ask the user rather than pass an empty or guessed nodeId. It does not explicitly route the agent among siblings such as get_metadata or get_screenshot, so it stops short of naming alternatives.

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