Skip to main content
Glama

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

NameRequiredDescriptionDefault

No arguments

Input Schema (JSON Schema)

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

Implementation Reference

  • 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) }`, }, ], }; } } );
  • 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.
    {},

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

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