get_styles
Extract all design styles from a Figma document directly, enabling efficient access to typography, colors, and effects for streamlined design workflows.
Instructions
Get all styles from the current Figma document
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- The inline handler and registration for the 'get_styles' MCP tool. It executes by sending the 'get_styles' command to the Figma plugin via websocket and returns the result as a text content block or an error message.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)}`, }, ], }; } } );
- Part of the FigmaCommand type union, defining 'get_styles' as a valid command type for the Figma plugin.| "get_styles"