get_styles
Retrieve all design styles from a Figma document to streamline design workflows and ensure consistency across projects within the Cursor Talk to Figma MCP server.
Instructions
Get all styles from the current Figma document
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/talk_to_figma_mcp/server.ts:942-969 (handler)Handler function for the 'get_styles' MCP tool. It sends a 'get_styles' command to the Figma plugin via WebSocket and returns the JSON-stringified result 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) }`, }, ], }; } } );
- src/talk_to_figma_mcp/server.ts:942-969 (registration)Registration of the 'get_styles' tool using McpServer.tool(), including name, description, input schema (empty), and handler function.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) }`, }, ], }; } } );
- Input schema for 'get_styles' tool: empty object indicating no parameters required.{},