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 () => {
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It states a read operation ('Get') but doesn't disclose behavioral traits such as permissions needed, rate limits, whether it returns all styles at once or paginated, or what happens in edge cases like no styles present. This leaves significant gaps for a tool with no annotation coverage.

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 front-loads the core action and resource. It wastes no words and is appropriately sized for a simple tool with no parameters, making it easy for an agent to parse quickly.

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

Completeness3/5

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

Given the tool's simplicity (0 parameters, no output schema, no annotations), the description is minimally adequate. It states what the tool does but lacks details on behavior, output format, or context. For a read operation with no structured output, more guidance on what 'styles' entails would improve completeness, but it meets the baseline for a basic tool.

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 input schema has 0 parameters with 100% coverage, so no parameter information is needed. The description doesn't add param details, but since there are no params, this is acceptable. Baseline is 4 as per rules for 0 parameters, as the schema fully covers the absence of inputs.

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 the resource 'all styles from the current Figma document', making the purpose specific and understandable. However, it doesn't explicitly differentiate from sibling tools like 'get_document_info' or 'get_local_components', which might also retrieve document-related data, leaving some ambiguity about scope.

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. With siblings like 'get_document_info' that might include style information, there's no indication of context, prerequisites, or exclusions, leaving the agent to infer usage based on tool names 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

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