Skip to main content

Description

Returns a high-level overview of the project structure, showing the top-level hierarchy of the game. This is essentially a convenience wrapper around get_file_tree with sensible defaults for getting a project overview. By default, it shows 2 levels of depth starting from the root game object.

HTTP Endpoint

POST /tool/get_project_structure

Request Parameters

depth
number
default:"2"
Maximum depth to traverse (capped at 3)

Response Format

Same as get_file_tree response format:
name
string
Name of the root instance (typically “game”)
className
string
Class name of the root
childCount
number
Number of immediate children
children
array
Array of child instances (recursive structure)
truncated
boolean
True if result was truncated
note
string
Additional information about truncation

Example

const response = await fetch('http://127.0.0.1:7766/tool/get_project_structure', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    depth: 2
  })
});

const data = await response.json();
console.log(data.result);

// Example output:
// {
//   "name": "game",
//   "className": "DataModel",
//   "childCount": 15,
//   "children": [
//     {
//       "name": "Workspace",
//       "className": "Workspace",
//       "childCount": 8,
//       "children": [
//         { "name": "Baseplate", "className": "Part", "childCount": 0 },
//         { "name": "Camera", "className": "Camera", "childCount": 0 }
//       ]
//     },
//     {
//       "name": "ReplicatedStorage",
//       "className": "ReplicatedStorage",
//       "childCount": 5,
//       "children": [
//         { "name": "Modules", "className": "Folder", "childCount": 3 },
//         { "name": "Assets", "className": "Folder", "childCount": 12 }
//       ]
//     }
//   ]
// }

Implementation Details

From InstanceTools.lua:93-95:
  • Simple wrapper that calls get_file_tree with no path and specified depth
  • Defaults to depth of 2 for a balanced overview
  • Inherits all behavior and limits from get_file_tree

Build docs developers (and LLMs) love