Skip to main content
Glama
paragdesai1

Cursor Talk to Figma MCP

by paragdesai1

get_styles

Retrieve all design styles from a Figma document to access color palettes, typography, and other visual elements for consistent design implementation.

Instructions

Get all styles from the current Figma document

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The 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 as text content, or an error message if failed. This is the core execution logic of the 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) }`, }, ], }; } } );
  • Registration of the 'get_styles' tool using McpServer.tool() with name, description, empty input schema ({}), and inline 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) }`, }, ], }; } } );
  • Empty input schema for the get_styles tool (no parameters required).
    async () => {

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/paragdesai1/parag-Figma-MCP'

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