Skip to main content
Glama

get_styles

Retrieve all style definitions from a Figma document to inspect text, color, and effect styles for design consistency and reuse.

Instructions

Get all styles from the current Figma document

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler implementation for the MCP 'get_styles' tool. It forwards the command to the Figma plugin via websocket and returns the styles as JSON text.
    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 document tools (including get_styles) by calling registerDocumentTools on the MCP server.
    registerDocumentTools(server);
  • Top-level registration of all tools (including get_styles) on the MCP server instance.
    registerTools(server);
  • Type definition for FigmaCommand union that includes 'get_styles' as a valid command type sent to the Figma plugin.
    export type FigmaCommand =
      | "get_document_info"
      | "get_selection"
      | "get_node_info"
      | "create_rectangle"
      | "create_frame"
      | "create_text"
      | "create_ellipse"
      | "create_polygon"
      | "create_star"
      | "create_vector"
      | "create_line"
      | "set_fill_color"
      | "set_stroke_color"
      | "move_node"
      | "resize_node"
      | "delete_node"
      | "get_styles"
      | "get_local_components"
      | "get_team_components"
      | "create_component_instance"
      | "export_node_as_image"
      | "join"
      | "set_corner_radius"
      | "clone_node"
      | "set_text_content"
      | "scan_text_nodes"
      | "set_multiple_text_contents"
      | "set_auto_layout"
      | "set_font_name"
      | "set_font_size"
      | "set_font_weight"
      | "set_letter_spacing"
      | "set_line_height"
      | "set_paragraph_spacing"
      | "set_text_case"
      | "set_text_decoration"
      | "get_styled_text_segments"
      | "load_font_async"
      | "get_remote_components"
      | "set_effects"
      | "set_effect_style_id"
      | "group_nodes"
      | "ungroup_nodes"
      | "flatten_node"
      | "insert_child";

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.6/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It only says 'Get', implying a read operation, but does not clarify what kinds of styles are included (fill, text, effect, grid), whether library styles are returned, or what the response contains. This is minimal behavioral detail.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, front-loaded sentence with no filler. Every word earns its place, and the verb-resource-scope structure makes it easy to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple zero-parameter getter, the description is largely sufficient: an agent knows what action to take and what resource to expect. The main gap is the ambiguous scope of 'styles', which could be interpreted in multiple ways, but the overall call is straightforward.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has zero parameters, so the schema requires no documentation. The baseline of 4 applies because there are no parameter semantics to clarify; the description does not need to add parameter-level meaning.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb ('Get'), a clear resource ('all styles'), and a scope ('current Figma document'). It is immediately distinguishable from sibling tools like get_local_components or get_document_info, which target different resources.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no guidance on when to use this tool versus alternatives such as get_local_components or get_document_info. The phrase 'from the current Figma document' gives some context, but no explicit conditions, exclusions, or alternative-tool routing are provided.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.