get_document_info
Retrieve comprehensive details about the active Figma document, enabling users to access design data and automate tasks directly through natural language commands.
Instructions
Get detailed information about the current Figma document
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/talk_to_figma_mcp/server.ts:95-122 (handler)The handler function for the 'get_document_info' MCP tool. It sends a 'get_document_info' command to the Figma plugin via WebSocket (using sendCommandToFigma helper) and returns the result as formatted text 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) } ] }; } 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:95-122 (registration)Registration of the 'get_document_info' tool using McpServer.tool() with empty input schema ({}). This is the primary location where the tool is defined in the MCP server.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) }`, }, ], }; } } );
- Input schema for get_document_info tool: empty object {}, indicating no parameters required.{},