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
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "get_selection"
}
}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) }`, }, ], }; } } );