get_local_components
Retrieve all local components from a Figma document to access design elements for automation or integration tasks.
Instructions
Get all local components from the Figma document
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "get_local_components"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/talk_to_figma_mcp/server.ts:972-999 (handler)The complete handler function and registration for the 'get_local_components' MCP tool. It calls sendCommandToFigma to delegate the logic to the Figma plugin and formats the response as a text content block with JSON stringified result, handling errors appropriately.
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) }`, }, ], }; } } ); - Empty input schema for the get_local_components tool (no parameters required).
{}, - TypeScript type definition confirming empty parameters (Record<string, never>) for the get_local_components command in FigmaCommandParams.
get_local_components: Record<string, never>; - src/talk_to_figma_mcp/server.ts:2563-2583 (registration)The get_local_components command is included in the FigmaCommand type union, confirming its registration in the command handling system.
| "get_local_components" | "create_component_instance" | "get_instance_overrides" | "set_instance_overrides" | "export_node_as_image" | "join" | "set_corner_radius" | "clone_node" | "set_text_content" | "scan_text_nodes" | "set_multiple_text_contents" | "get_annotations" | "set_annotation" | "set_multiple_annotations" | "scan_nodes_by_types" | "set_layout_mode" | "set_padding" | "set_axis_align" | "set_layout_sizing" | "set_item_spacing" | "get_reactions"