get_selection
Retrieve details about currently selected elements in Figma to enable automated design workflows through natural language commands.
Instructions
Get information about the current selection in Figma
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/talk_to_figma_mcp/server.ts:125-152 (registration)Registration of the MCP tool 'get_selection' with inline handler function. The handler proxies the request to the Figma plugin by calling sendCommandToFigma('get_selection'), formats the result as text content, and handles errors.
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) }`, }, ], }; } } );