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
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/talk_to_figma_mcp/server.ts:96-122 (handler)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) }`, }, ], }; } } ); - src/talk_to_figma_mcp/server.ts:96-122 (registration)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 () => {