Skip to main content
Glama

get_local_components

Extract all local components from a Figma document to support AI-assisted design workflows, enabling efficient organization and reuse of design elements.

Instructions

Get all local components from the Figma document

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the 'get_local_components' tool. It sends a 'get_local_components' command to the Figma plugin via WebSocket and returns the result as JSON text content, with error handling.
    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)}`, }, ], }; } } );
  • The 'get_local_components' tool is registered here on the MCP server using server.tool(), with no input parameters ({} schema). The registration includes the inline handler.
    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)}`, }, ], }; } } );
  • The tool command 'get_local_components' is included in the FigmaCommand type union, defining supported Figma plugin commands.
    | "get_local_components"

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/arinspunk/claude-talk-to-figma-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server