Skip to main content
Glama
yhc984
by yhc984

get_document_info

Retrieve detailed metadata and insights about your current Figma design document to enhance understanding and streamline design workflows.

Instructions

Get detailed information about the current Figma document

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Core handler function that implements get_document_info by loading the current Figma page and returning structured document information including name, ID, type, children, and page details.
    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, }, ], }; }
  • MCP tool registration for 'get_document_info' including description, empty input schema ({}), and handler that proxies the command to the Figma plugin via WebSocket, formats the result as MCP content, with error handling.
    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, null, 2) } ] }; } catch (error) { return { content: [ { type: "text", text: `Error getting document info: ${error instanceof Error ? error.message : String(error)}` } ] }; } } );
  • Dispatch/registration case in the command handler switch statement that routes 'get_document_info' calls to the getDocumentInfo function.
    case "get_document_info": return await getDocumentInfo();
  • Input schema for the MCP tool 'get_document_info', which takes no parameters.
    {},

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/yhc984/cursor-talk-to-figma-mcp-main'

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