figma_get_components
Retrieve all components and variant sets from a Figma file, plus library components used, with instance counts for each.
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. Dated by exportedAt and account, or fileModifiedAt for a file read from disk, as the server's instructions say (figma-reader help on the command line).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file | Yes | A local .fig path, a Figma file key or a figma.com/design/... URL (see the server's instructions, or figma-reader help) | |
| query | No | Case-insensitive filter on name; a component set matches when the set or any of its variants does | |
| refresh | No | Export the live file again rather than read a local or cached copy (see the server's instructions, or figma-reader help) |