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
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/cursor_mcp_plugin/code.js:110-135 (handler)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, }, ], }; }
- src/talk_to_figma_mcp/server.ts:32-58 (registration)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)}` } ] }; } } );
- src/cursor_mcp_plugin/code.js:64-65 (handler)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.{},