Skip to main content
Glama
LeoGCode

figma-reader-mcp

by LeoGCode

figma_get_components

Read-only

Get component definitions and usage counts from a Figma file, including variant sets and library components, with optional name filtering and live refresh.

Instructions

The components this file defines, and the library components it uses. componentSets are the variant sets, with their description, property definitions and one entry per variant carrying that variant's counts; components are the ones outside a set, each with a size and its own counts. A count is instances placed directly, plus swapInstances where the component is swapped into an instance (by an override or an instance-swap property). libraryComponentsUsed is a third list: components defined in other files, by name, with the variants used and the same two counts. Internal-only pages are left out of all three lists but not out of the counts: an instance placed on one still counts for the component it is of, except for a library component, whose uses on such a page are skipped. The result is dated by the copy it answers from. exportedAt is the ISO-8601 time this tool exported that snapshot through the browser: report what the design said then rather than as current, and pass refresh to export it again. For a local .fig the field is fileModifiedAt, that copy's own file time, which copying, syncing or re-downloading the file resets: the design data can be older than it says, and nothing here can date it.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fileYesPath to a local .fig file, or a Figma file key / figma.com/design/... URL. A node-id in the URL is used when this tool takes node_id and it is omitted; a tool that answers about the whole file ignores it. A key or URL uses a local '<name> [<key>].fig' from FIGMA_FILES_DIRS when one exists, otherwise exports through the browser.
queryNoCase-insensitive filter on name; a component set matches when the set or any of its variants does
refreshNoSkip local/cached copies and export the live file through the browser. Has no effect when file is a path to a .fig: that file is read as it is on disk and the result carries refreshIgnored; pass the key or URL to export the live file instead.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already indicate readOnlyHint=true, so the description doesn't need to repeat that. It adds substantial behavioral context: it explains that internal-only pages are excluded from lists but still counted (except library components on such pages are skipped), and it clarifies the meaning of 'exportedAt' and 'fileModifiedAt' including the fact that local .fig file times can be unreliable. This goes beyond annotations and helps the agent understand the data's freshness.

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?

The description is a single dense paragraph, which is somewhat heavy but every sentence adds important technical detail about the tool's output and edge cases. It is front-loaded with the core content and then explains nuances; a slight structure improvement would be splitting into bullet points, but it's efficient overall.

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?

The description covers the tool's output structure, counting logic, edge cases (internal-only pages), and staleness semantics, including the difference between URL and local file paths. Given the complexity of the tool and the absence of an output schema, the description is remarkably complete for an agent to understand what it returns and how to interpret it.

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 fully documents parameters. The description adds no new parameter semantics beyond what the schema already says; it mentions 'refresh' but not in a way that expands on the parameter description. Thus a 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?

The description clearly identifies the tool as returning component definitions and usage counts from a Figma file, with a specific structure distinguishing componentSets, components, and libraryComponentsUsed. It is distinct from siblings like figma_get_tree or figma_get_node because it focuses on components specifically.

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?

The description implicitly covers when to use this tool (when you need component definitions and usage counts) and provides important guidance on staleness: it explains the exportedAt field, when refresh is needed, and the caveat about local .fig files. Sibling tools are not explicitly named, but the clear scope and context make usage clear.

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