Skip to main content
Glama
yhoyoex

OpenCode Figma MCP

by yhoyoex

get_design_context

Reads Figma frames or current selection and returns a compact, code-oriented spec for generating UI code, covering layout, styles, text, components, variables, and assets.

Instructions

Read a Figma design from the open file through the plugin and return a compact, code-oriented spec (layout, styles, text, components, variables, assets) for generating UI code. Uses the given nodeIds or the current selection. Spec format: each node references shared values in styles by id (layout*, fill*, stroke*, effect*, text*). Layout values are CSS-like (flex, gap, padding, sizing fill/hug/fixed). exportAs: svg marks icons/vectors to export as assets instead of rebuilding them; assets lists icons and image fills to download with download_design_assets. designStyles and variables give design-token names to map onto the project's theme.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nodeIdsNoNode IDs to read. Defaults to the current selection in Figma.
maxDepthNoMaximum depth of children to include (default: unlimited)
includeHiddenNoInclude hidden layers (default: false)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.1.1

TDQS

A4.2/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 does well: it discloses the returned spec's structure, the shared-value indirection (styles referenced by id via layout*/fill*/stroke*/effect*/text*), CSS-like layout semantics, the exportAs:svg convention, and the designStyles/variables token exposure. It omits read-only/auth permissions and any rate/scope limits, but the read nature is clear.

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, then dense but purposeful detail on spec format and token mapping. Every clause is substantive, though the single long paragraph could be slightly tightened without loss.

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?

No output schema exists, so the description must explain the return value, and it does so thoroughly: the spec's node/style indirection, layout conventions, asset markers, and token names. An agent has enough to call and interpret the result 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 coverage is 100%, so nodeIds, maxDepth, and includeHidden are already documented. The description confirms that nodeIds defaults to the current selection but adds no depth/hidden-layer guidance, and it mentions an 'exportAs' option that isn't an actual input parameter. Baseline 3 is appropriate when the schema does the heavy lifting.

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 ('Read'), resource (a Figma design from the open file), and a precise deliverable: a 'compact, code-oriented spec (layout, styles, text, components, variables, assets) for generating UI code.' This differentiates it from generic readers like read_my_design, get_node_info, and get_nodes_info by its code-generation orientation.

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?

Explains input routing ('Uses the given nodeIds or the current selection') and hands off a related task ('assets lists icons and image fills to download with download_design_assets'). It does not, however, explicitly state when to prefer this over siblings like read_my_design or get_node_info, so routing is implied rather than spelled out.

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