get_styles
Retrieve all design styles from your current Figma document to maintain consistency and accelerate design workflows.
Instructions
Get all styles from the current Figma document
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- The complete handler implementation for the 'get_styles' MCP tool. It registers the tool with an empty input schema and executes by sending a 'get_styles' command to the Figma plugin via sendCommandToFigma, returning the result as a text/JSON content block or an error message.// Get Styles Tool server.tool( "get_styles", "Get all styles from the current Figma document", {}, async () => { try { const result = await sendCommandToFigma("get_styles"); return { content: [ { type: "text", text: JSON.stringify(result) } ] }; } catch (error) { return { content: [ { type: "text", text: `Error getting styles: ${error instanceof Error ? error.message : String(error)}`, }, ], }; } } );
- src/talk_to_figma_mcp/tools/index.ts:12-19 (registration)Higher-level registration where document tools (including get_styles) are registered to the MCP server via registerDocumentTools.export function registerTools(server: McpServer): void { // Register all tool categories registerDocumentTools(server); registerCreationTools(server); registerModificationTools(server); registerTextTools(server); registerComponentTools(server); }
- src/talk_to_figma_mcp/server.ts:34-35 (registration)Top-level server initialization where all tools are registered by calling registerTools.registerTools(server);