uloop-get-hierarchy
uloop get-hierarchy
Get Unity Hierarchy structure from the whole scene, a root path, or selected Hierarchy objects.
Use this for hierarchy structure, especially descendants under the current selection. Use find-game-objects --search-mode Selected when you need selected object details or component properties.
Usage
uloop get-hierarchy [options]
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
--root-path |
string | - | Root GameObject path to start from |
--max-depth |
integer | -1 |
Maximum depth (-1 for unlimited) |
--include-components |
boolean | true |
Include component information |
--include-inactive |
boolean | true |
Include inactive GameObjects |
--include-paths |
boolean | false |
Include full path information |
--use-components-lut |
string | auto |
Use LUT for components (auto, true, false) |
--use-selection |
boolean | false |
Use selected GameObject(s) as root(s). When true, --root-path is ignored. |
Global Options
| Option | Description |
|---|---|
--project-path <path> |
Optional. Use only when the target Unity project is not the current directory. |
Examples
# Get entire hierarchy
uloop get-hierarchy
# Get hierarchy from specific root
uloop get-hierarchy --root-path "Canvas/UI"
# Limit depth
uloop get-hierarchy --max-depth 2
# Without components
uloop get-hierarchy --include-components false
# Get hierarchy from currently selected GameObjects
uloop get-hierarchy --use-selection
Output
Returns JSON with:
message(string): Human-readable guidance pointing at the saved filehierarchyFilePath(string): Filesystem path to the JSON file that contains the actual hierarchy data
The hierarchy itself is not in the response — it is written to the file at hierarchyFilePath. Open that file to read the Context and Hierarchy payload (GameObject tree, components, etc.).
More from hatayama/uloopmcp
uloop-find-game-objects
Use first when the user asks about the currently selected GameObject in the Unity Hierarchy. Inspect selected object details with `--search-mode Selected` before using `execute-dynamic-code`. Use when you need to: (1) Get details and component properties for selected GameObject(s), (2) Search for objects by name, regex, or path, (3) Find objects with specific components, tags, or layers. Use get-hierarchy when the child tree under the selection is needed. Returns hierarchy paths, active state, tags, layers, and components (or writes to a file when multiple GameObjects are selected).
37uloop-unity-search
Search Unity project assets using Unity Search engine. Use when you need to: (1) Find scenes, prefabs, scripts, materials, or other assets, (2) Filter assets by file extension or type, (3) Search with Unity Search query syntax and specific providers. Returns asset paths and metadata.
36uloop-clear-console
Clear all Unity Console log entries. Use when you need to: (1) Clear console before running tests or compilation, (2) Start a fresh debugging session, (3) Remove noisy logs to isolate specific output.
36uloop-run-tests
Execute Unity Test Runner and get detailed results. Use when you need to: (1) Run EditMode or PlayMode unit tests, (2) Verify code changes pass all tests, (3) Diagnose test failures with error messages and stack traces. Single-flight only — never run multiple `uloop run-tests` in parallel.
35uloop-compile
Compile Unity project and report errors/warnings. Use when you need to: (1) Verify code compiles after C# file edits, (2) Check for compile errors before testing, (3) Force full recompilation with Domain Reload. Returns error and warning counts.
34uloop-get-menu-items
Discover available Unity Editor menu items. Use when you need to: (1) Find available menu commands and their paths, (2) Search for specific menu items by name, (3) Prepare menu item paths for execute-menu-item. Returns menu item list.
33