Skip to main content

Overview

Retrieves information about the currently selected nodes in Figma, including their IDs, names, types, and basic properties.

Parameters

This tool does not require any parameters.

Return Value

Returns an array of selected nodes:
[
  {
    "id": "node-id",
    "name": "Frame 1",
    "type": "FRAME",
    "x": 100,
    "y": 200,
    "width": 300,
    "height": 400
  }
]
If no nodes are selected, returns an empty array.

Usage Example

const selection = await use_mcp_tool({
  server_name: "TalkToFigma",
  tool_name: "get_selection",
  arguments: {}
});

if (selection.length === 0) {
  console.log("No nodes selected");
} else {
  console.log(`Selected ${selection.length} node(s)`);
  selection.forEach(node => {
    console.log(`- ${node.name} (${node.type})`);
  });
}

Best Practices

Always check if the selection is empty before performing operations. An empty selection will cause most modification tools to fail.
Use get_selection before calling modification tools to confirm you’re working with the correct nodes.

Common Use Cases

  • Verifying which nodes are selected before modifications
  • Getting IDs of selected nodes for batch operations
  • Checking selection state in workflows
  • Validating user selection before operations

Build docs developers (and LLMs) love