Skip to main content
Glama
grab

Talk to Figma MCP

by grab

get_local_components

Retrieve all local components from a Figma document to enable efficient design management and modification through programmatic interactions.

Instructions

Get all local components from the Figma document

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • MCP tool registration and handler function for 'get_local_components'. Proxies the call to the Figma plugin via sendCommandToFigma and formats the result as text content with JSON stringified response or error message.
    server.tool(
      "get_local_components",
      "Get all local components from the Figma document",
      {},
      async () => {
        try {
          const result = await sendCommandToFigma("get_local_components");
          return {
            content: [
              {
                type: "text",
                text: JSON.stringify(result)
              }
            ]
          };
        } catch (error) {
          return {
            content: [
              {
                type: "text",
                text: `Error getting local components: ${error instanceof Error ? error.message : String(error)
                  }`,
              },
            ],
          };
        }
      }
    );
  • Input schema for the tool: empty object indicating no parameters required.
    {},
  • Registration of the MCP tool using server.tool() with name, description, schema, and handler.
    server.tool(
      "get_local_components",
      "Get all local components from the Figma document",
      {},
      async () => {
        try {
          const result = await sendCommandToFigma("get_local_components");
          return {
            content: [
              {
                type: "text",
                text: JSON.stringify(result)
              }
            ]
          };
        } catch (error) {
          return {
            content: [
              {
                type: "text",
                text: `Error getting local components: ${error instanceof Error ? error.message : String(error)
                  }`,
              },
            ],
          };
        }
      }
    );
  • TypeScript type definition for command parameters in CommandParams interface, confirming no parameters.
    get_local_components: Record<string, never>;
    get_team_components: Record<string, never>;
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states what the tool does but doesn't describe how it behaves: no information about return format (list, structure, pagination), permissions needed, rate limits, or error conditions. For a read operation with zero annotation coverage, this leaves significant gaps.

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 with zero wasted words. It's appropriately sized for a simple retrieval tool and front-loads the core functionality. 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?

Given no annotations, no output schema, and a simple but potentially complex operation (retrieving 'all local components'), the description is insufficient. It doesn't explain what 'local components' means in Figma context, what format the return takes, or any limitations. For a tool that could return substantial data, more context is needed.

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 0 parameters with 100% schema description coverage (empty schema). The description doesn't need to compensate for any parameter gaps. Baseline for 0 parameters is 4, as there's nothing to document beyond what the schema already provides (no parameters).

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 'local components from the Figma document', making the purpose unambiguous. It doesn't explicitly distinguish from siblings like 'get_styles' or 'get_document_info', but the specificity of 'local components' provides reasonable differentiation. It avoids tautology by not just restating the name.

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 like 'get_document_info' or 'get_styles'. It doesn't mention prerequisites, context, or exclusions. The agent must infer usage from the name and description alone without explicit direction.

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