get_document_info
Retrieve comprehensive details about the active Figma document, enabling AI tools to analyze and interact with design elements effectively.
Instructions
Get detailed information about the current Figma document
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {},
"type": "object"
}
Implementation Reference
- src/talk_to_figma_mcp/tools/document-tools.ts:12-38 (registration)Registers the 'get_document_info' MCP tool. The handler sends a 'get_document_info' command to the Figma plugin via websocket and returns the result as a text content block containing JSON stringified document information. Handles errors by returning an error message.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)}`, }, ], }; } } );