Skip to main content
Glama
southleft

figma-console-mcp

by southleft

figma_get_code_layers

Locate Figma code layers (CODE_INSTANCE) on a page or across a file to retrieve their position, size, page, and linked dev resources or source links.

Instructions

Find code layers (Figma's React code layers, node type CODE_INSTANCE) on the current page or across the file, with position, size, page, and any dev resources or related links (e.g. the GitHub source). The Plugin API and REST API expose code layers as rendered layers only: their source and props can't be read or edited, and new code layers can't be created through them. Create or edit code layers in Figma, through a GitHub import, or with Figma's own MCP server (send_code_to_figma). Use figma_capture_screenshot with a code layer's id to see it. Figma only returns links while the file's window is focused; otherwise the result has linksUnavailable: true and omits them. Requires Desktop Bridge.

Input Schema

NameRequiredDescriptionDefault
limitNo
scopeNoSearch the current page (default) or every pagepage
fileKeyNoLocal Mode only. Run against this connected file instead of the active file. Rejected in Cloud Mode.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.46.0

TDQS

A4.5/5.0
Behavior5/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 so: it discloses that code layers are rendered-only, that a Desktop Bridge is required, and a non-obvious failure mode where links are omitted and 'linksUnavailable: true' appears unless the file window is focused. That conditional-result detail is exactly the kind of thing an agent could not infer elsewhere.

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 limitations, then alternatives, then the focus caveat and the bridge requirement. Every sentence carries information, though the trailing 'Requires Desktop Bridge.' reads as appended rather than integrated and the block could be split for scanability.

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?

For a 3-parameter, no-output-schema read tool with no annotations, the description covers purpose, limits, prerequisites, and result fields. The remaining gap is pagination/limit semantics and what a result entry looks like beyond the field list, but nothing essential to calling it correctly is missing.

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 67% — scope and fileKey are already documented in the schema, and the description merely restates scope ('on the current page or across the file'). The limit parameter (default 100, max 500) is undocumented in both schema and description, so pagination behavior is left unexplained.

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?

Names a specific verb+resource and defines it precisely ('Figma's React code layers, node type CODE_INSTANCE'), then lists what it returns (position, size, page, dev resources/links) and the scope options. No sibling tool does this, and the description makes that distinction explicit by naming figma_capture_screenshot and send_code_to_figma as the adjacent tools.

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?

Gives the use case, explicit exclusions ('their source and props can't be read or edited, and new code layers can't be created through them'), and concrete alternatives for the excluded case (Figma UI, GitHub import, Figma's own MCP server send_code_to_figma). It also routes the agent onward to figma_capture_screenshot to visually inspect a found layer.

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