get_selection
Retrieve details about the current selection in Figma to enable programmatic design automation and improve workflow efficiency through natural language commands.
Instructions
Get information about the current selection in Figma
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/server.ts:126-152 (registration)Registration and handler implementation of the MCP tool 'get_selection'. It registers the tool with an empty input schema and provides an inline async handler that sends a 'get_selection' command to the Figma plugin via sendCommandToFigma, then returns the result as JSON-formatted text content or an error message."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) }`, }, ], }; } } );