Skip to main content
Glama
andreycretsu

Cursor Talk to Figma MCP

by andreycretsu

get_document_info

Retrieve detailed information about the current Figma document to understand design structure and components for automation tasks.

Instructions

Get detailed information about the current Figma document

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the 'get_document_info' tool. It sends a 'get_document_info' command to the Figma plugin via WebSocket (using sendCommandToFigma helper), stringifies the result as text content, and handles errors appropriately. This also serves as the tool registration via McpServer.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)
                  }`,
              },
            ],
          };
        }
      }
    );
  • Registration of the 'get_document_info' tool using McpServer.tool(), with empty input schema ({}), description, and inline handler.
      "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)
                  }`,
              },
            ],
          };
        }
      }
    );
  • Input schema for 'get_document_info' tool: empty object ({}), indicating 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 of behavioral disclosure. It states 'Get detailed information' but doesn't specify what information is included, whether it's read-only, if it requires permissions, or how it handles errors. For a tool with no annotation coverage, this is insufficient to inform safe and effective use.

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 directly states the tool's purpose without any wasted words. It's front-loaded and appropriately sized for a simple tool, making it easy to parse quickly.

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 the tool's complexity (0 parameters, no output schema, no annotations), the description is incomplete. It doesn't explain what 'detailed information' entails, the return format, or behavioral aspects like read-only nature. For a tool in a design context with siblings that handle specific data, more context is needed to guide the agent effectively.

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, and schema description coverage is 100%, so there are no parameters to document. The description doesn't need to add parameter semantics, but it could hint at implicit context like 'current document' if relevant. Since no parameters exist, a baseline of 4 is appropriate as there's nothing to compensate for.

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 'detailed information about the current Figma document', making the purpose specific and understandable. However, it doesn't explicitly differentiate from siblings like 'get_node_info' or 'get_nodes_info', which focus on nodes rather than the entire document, 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. It doesn't mention context like needing document-level metadata, prerequisites, or exclusions, such as not using it for node-specific details. This lack of usage context leaves the agent to infer 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/andreycretsu/cursor-talk-to-figma-mcp-main'

If you have feedback or need assistance with the MCP directory API, please join our Discord server