Skip to main content

Overview

Retrieves all local components defined in the current Figma document. This includes main components but not component instances.

Parameters

This tool takes no parameters.

Response

Returns a JSON object containing all local components:
components
array
Array of component objects from the Figma document

Usage Example

// Get all local components from the document
const result = await get_local_components();

console.log(result);
// {
//   "components": [
//     {
//       "id": "123:456",
//       "key": "abc123def456",
//       "name": "Button/Primary",
//       "description": "Primary call-to-action button",
//       "type": "COMPONENT"
//     },
//     {
//       "id": "789:012",
//       "key": "ghi789jkl012",
//       "name": "Card/Product",
//       "description": "Product display card",
//       "type": "COMPONENT"
//     }
//   ]
// }

Common Use Cases

Component Catalog

Build a catalog of available components in your design system

Instance Creation

Get component keys needed for creating instances programmatically

Documentation

Auto-generate component library documentation

Inventory Management

Track and manage components across your design files

Workflow

1

Get components

Call get_local_components() to retrieve all main components
2

Find target component

Locate the component you want to use by name or key
3

Create instances

Use the component’s key with create_component_instance

Notes

  • Only returns main components (not instances)
  • Only local components are included (not library components from other files)
  • The key field is essential for creating instances with create_component_instance
  • Components are returned in the order they appear in the document

Build docs developers (and LLMs) love