Skip to main content
Glama
by grab

get_styles

Retrieve all styles from the current Figma document programmatically using natural language commands, enabling efficient design data access and management.

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

  • MCP tool registration and handler implementation for 'get_styles'. This function sends a 'get_styles' command to the connected Figma plugin via WebSocket (using sendCommandToFigma) and returns the result as a JSON-formatted text content block, with error handling.
    "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) }`, }, ], }; } }
  • TypeScript type definition confirming the 'get_styles' command takes no parameters (empty object).
    get_styles: Record<string, never>; get_local_components: Record<string, never>;
  • The 'get_styles' command is registered in the FigmaCommand union type used by the sendCommandToFigma helper function.
    | "get_styles" | "get_local_components" | "create_component_instance" | "get_instance_overrides" | "set_instance_overrides" | "export_node_as_image" | "join" | "set_corner_radius" | "clone_node" | "set_text_content" | "scan_text_nodes" | "set_multiple_text_contents" | "get_annotations" | "set_annotation" | "set_multiple_annotations" | "scan_nodes_by_types" | "set_layout_mode" | "set_padding" | "set_axis_align" | "set_layout_sizing" | "set_item_spacing" | "get_reactions" | "set_default_connector" | "create_connections" | "set_focus"

Other Tools

Related Tools

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

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