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
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {},
"type": "object"
}
Implementation Reference
- src/talk_to_figma_mcp/server.ts:966-993 (handler)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.{},
- src/talk_to_figma_mcp/server.ts:966-993 (registration)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>;