Skip to main content
Glama
grab

Talk to Figma MCP

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

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

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"
Behavior2/5

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

With no annotations provided, the description carries full burden but offers minimal behavioral insight. It states it retrieves 'all styles' but doesn't clarify what 'styles' encompass (colors, text styles, effects), whether this includes local vs. library styles, pagination behavior, or error conditions. The description doesn't contradict annotations (none exist), but provides inadequate transparency for a read operation.

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, efficient sentence that states exactly what the tool does without unnecessary words. It's front-loaded with the core action ('Get all styles') and specifies the scope ('from the current Figma document'). Every word earns its place.

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

Completeness2/5

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

For a read operation with no annotations, no output schema, and zero parameters, the description is insufficient. It doesn't explain what 'styles' include, the return format, or how this differs from similar retrieval tools. While the lack of parameters simplifies things, the description should provide more context about the data returned and its relationship to other document query tools.

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, and schema description coverage is 100% (empty schema). The description appropriately doesn't discuss parameters since none exist, and it correctly implies this is a parameterless operation that retrieves all styles from the current context. This meets the baseline for zero-parameter tools.

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

Purpose4/5

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

The description clearly states the verb ('Get') and resource ('all styles from the current Figma document'), making the purpose immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'get_document_info' or 'get_local_components', which also retrieve document metadata but focus on 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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention whether this is for retrieving design tokens, when to prefer this over 'get_document_info' for style-related queries, or any prerequisites like needing an open document. The agent must infer usage from context alone.

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

Install Server

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