Skip to main content
Glama
paragdesai1

Cursor Talk to Figma MCP

by paragdesai1

get_document_info

Retrieve detailed information about the current Figma document to understand its structure and contents for design analysis.

Instructions

Get detailed information about the current Figma document

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Registration of the MCP tool 'get_document_info' including its empty input schema, description, and handler function that proxies the request to the Figma plugin via sendCommandToFigma and formats the response.
    server.tool(
      "get_document_info",
      "Get detailed information about the current Figma document",
      {},
      async () => {
        try {
          const result = await sendCommandToFigma("get_document_info");
          return {
            content: [
              {
                type: "text",
                text: JSON.stringify(result)
              }
            ]
          };
        } catch (error) {
          return {
            content: [
              {
                type: "text",
                text: `Error getting document info: ${error instanceof Error ? error.message : String(error)
                  }`,
              },
            ],
          };
        }
      }
    );
  • The Figma plugin implementation of getDocumentInfo which returns structured information about the current page and its children. This is called by the MCP server handler.
    async function getDocumentInfo() {
      await figma.currentPage.loadAsync();
      const page = figma.currentPage;
      return {
        name: page.name,
        id: page.id,
        type: page.type,
        children: page.children.map((node) => ({
          id: node.id,
          name: node.name,
          type: node.type,
        })),
        currentPage: {
          id: page.id,
          name: page.name,
          childCount: page.children.length,
        },
        pages: [
          {
            id: page.id,
            name: page.name,
            childCount: page.children.length,
          },
        ],
      };
    }
  • Dispatch handler in Figma plugin code that routes 'get_document_info' command to the getDocumentInfo function.
    case "get_document_info":
      return await getDocumentInfo();
    case "get_selection":
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 of behavioral disclosure. It states it 'gets' information, implying a read-only operation, but doesn't specify permissions required, rate limits, or what 'detailed information' includes (e.g., document structure, metadata). This leaves gaps in understanding the tool's behavior beyond basic purpose.

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, clear sentence that efficiently conveys the tool's purpose without unnecessary words. It's front-loaded with the core action and resource, making it easy 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 has 0 parameters and no annotations or output schema, the description is minimally adequate but lacks depth. It doesn't explain what 'detailed information' entails or how it differs from other info-retrieval tools, leaving room for confusion in a context with multiple similar siblings.

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 documentation is needed. The description appropriately doesn't discuss parameters, focusing on the tool's purpose instead, which aligns with the schema's completeness.

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 tool's purpose with a specific verb ('Get') and resource ('detailed information about the current Figma document'), making it easy to understand what it does. However, it doesn't explicitly differentiate from sibling tools like 'get_node_info' or 'get_nodes_info', which also retrieve information but about specific nodes rather than the entire document.

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

Usage Guidelines3/5

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

The description implies usage by specifying 'current Figma document', suggesting it should be used when needing overall document metadata. However, it lacks explicit guidance on when to use this versus alternatives like 'get_node_info' for node-specific details or 'read_my_design' for broader design access, leaving some ambiguity.

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