Skip to main content

Description

Searches for instances whose names contain a specified query string. The search is case-insensitive and performs substring matching. You can optionally scope the search to a specific path and limit the number of results.

HTTP Endpoint

POST /tool/search_files

Request Parameters

query
string
required
The search query (case-insensitive substring match)
path
string
Root path to search within. Defaults to game (searches entire place). Examples: "Workspace", "ServerScriptService"
limit
number
default:"50"
Maximum number of results to return

Response Format

results
array
Array of matching instances
count
number
Number of results returned
truncated
boolean
True if more results exist beyond the limit
error
string
Error message if path resolution failed

Example

const response = await fetch('http://127.0.0.1:7766/tool/search_files', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    query: 'weapon',
    path: 'ReplicatedStorage',
    limit: 20
  })
});

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

// Example output:
// {
//   "results": [
//     {
//       "path": "ReplicatedStorage.Items.WeaponHandler",
//       "name": "WeaponHandler",
//       "className": "ModuleScript"
//     },
//     {
//       "path": "ReplicatedStorage.Assets.Weapon1",
//       "name": "Weapon1",
//       "className": "Model"
//     },
//     {
//       "path": "ReplicatedStorage.Assets.Weapon2",
//       "name": "Weapon2",
//       "className": "Model"
//     }
//   ],
//   "count": 3,
//   "truncated": false
// }

Implementation Details

From InstanceTools.lua:97-130:
  • Performs case-insensitive substring search using string.find()
  • Recursively scans all descendants
  • Stops searching when limit is reached
  • Returns full instance paths using buildPath()

Build docs developers (and LLMs) love