get_document_info
Retrieve detailed information about the current Figma document to understand its structure and properties for AI-assisted design workflows.
Instructions
Get detailed information about the current Figma document
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- The asynchronous handler function that implements the get_document_info MCP tool. It sends a 'get_document_info' command to the Figma plugin via WebSocket, stringifies the result as text content, or returns an error message.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)}`, }, ], }; } }
- src/talk_to_figma_mcp/tools/document-tools.ts:12-38 (registration)The server.tool() registration of the get_document_info tool, including name, description, empty input schema {}, and the handler function.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)}`, }, ], }; } } );
- Empty input schema for the get_document_info tool (no parameters required).{},
- Part of FigmaCommand type union, defining 'get_document_info' as a valid command sent to the Figma plugin.| "get_document_info"