get_selection
Retrieve detailed information about the current selection in Figma using this tool, enabling AI-assisted design workflows through direct interaction with the platform.
Instructions
Get information about the current selection in Figma
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- MCP tool registration and handler implementation for 'get_selection'. It sends a 'get_selection' command to Figma via WebSocket and returns the result as a JSON-formatted text response, with error handling.// Selection Tool server.tool( "get_selection", "Get information about the current selection in Figma", {}, async () => { try { const result = await sendCommandToFigma("get_selection"); return { content: [ { type: "text", text: JSON.stringify(result) } ] }; } catch (error) { return { content: [ { type: "text", text: `Error getting selection: ${error instanceof Error ? error.message : String(error)}`, }, ], }; } } );