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
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {},
"type": "object"
}
Implementation Reference
- src/talk_to_figma_mcp/server.ts:937-962 (handler)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>;
- src/talk_to_figma_mcp/server.ts:2626-2650 (registration)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"