Skip to main content
Glama
by grab

get_selection

Retrieve details about the currently selected elements in Figma, enabling users to analyze or modify designs programmatically through natural language commands.

Instructions

Get information about the current selection in Figma

Input Schema

NameRequiredDescriptionDefault

No arguments

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": {}, "type": "object" }

Implementation Reference

  • This is the registration and handler implementation for the MCP tool named 'get_selection'. It defines the tool with an empty input schema, and the handler sends a 'get_selection' command to the underlying Figma plugin via WebSocket (using sendCommandToFigma) and returns the result as a text content block containing the JSON-stringified response.
    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) }`, }, ], }; } } );

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/grab/cursor-talk-to-figma-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server