get_local_components
Retrieve all local components from a Figma document to enable efficient design access and manipulation for structured workflows.
Instructions
Get all local components from the Figma document
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/talk_to_figma_mcp/server.ts:972-999 (handler)The handler and registration for the MCP tool 'get_local_components'. This function sends a command to the Figma plugin via sendCommandToFigma('get_local_components'), receives the result, and formats it as MCP content. Error handling returns an error message.server.tool( "get_local_components", "Get all local components from the Figma document", {}, async () => { try { const result = await sendCommandToFigma("get_local_components"); return { content: [ { type: "text", text: JSON.stringify(result) } ] }; } catch (error) { return { content: [ { type: "text", text: `Error getting local components: ${error instanceof Error ? error.message : String(error) }`, }, ], }; } } );
- Type definition in CommandParams indicating the tool takes no parameters (empty object).get_local_components: Record<string, never>; get_team_components: Record<string, never>;
- Inclusion in FigmaCommand union type for command validation.| "get_local_components" | "create_component_instance"