Skip to main content

Description

Retrieves all instances currently selected in Roblox Studio’s Explorer. Returns the path, class name, and name for each selected instance.

Endpoint

get_selection

Parameters

This tool takes no parameters.

Response

selection
array
An array of objects representing each selected instance
selection[].path
string
The full path to the instance (e.g., “Workspace.Part”)
selection[].className
string
The class name of the instance (e.g., “Part”, “Model”, “Script”)
selection[].name
string
The name of the instance
count
number
The number of instances currently selected

Examples

Get current selection with multiple items

{}
Response:
{
  "selection": [
    {
      "path": "Workspace.Part1",
      "className": "Part",
      "name": "Part1"
    },
    {
      "path": "Workspace.Model.Part2",
      "className": "Part",
      "name": "Part2"
    }
  ],
  "count": 2
}

No selection

{}
Response:
{
  "selection": [],
  "count": 0
}

Single item selected

{}
Response:
{
  "selection": [
    {
      "path": "Workspace.SpawnLocation",
      "className": "SpawnLocation",
      "name": "SpawnLocation"
    }
  ],
  "count": 1
}

Build docs developers (and LLMs) love