Skip to main content
Glama
by grab

get_local_components

Retrieve all local components from a Figma document to enable efficient design management and modification through programmatic interactions.

Instructions

Get all local components from the Figma document

Input Schema

NameRequiredDescriptionDefault

No arguments

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": {}, "type": "object" }

Implementation Reference

  • MCP tool registration and handler function for 'get_local_components'. Proxies the call to the Figma plugin via sendCommandToFigma and formats the result as text content with JSON stringified response or 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) }`, }, ], }; } } );
  • Input schema for the tool: empty object indicating no parameters required.
    {},
  • Registration of the MCP tool using server.tool() with name, description, schema, and 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) }`, }, ], }; } } );
  • TypeScript type definition for command parameters in CommandParams interface, confirming no parameters.
    get_local_components: Record<string, never>; get_team_components: Record<string, never>;

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/grab/cursor-talk-to-figma-mcp'

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