Game-size profile: instance counts by ClassName
get-instance-countsTallies Roblox Instances by ClassName across the descendant tree, revealing place size and composition with heaviest classes first.
Instructions
In-game shape/size profile. Walks game:GetDescendants() once (pcall-guarded, capped) and tallies every Instance by its ClassName, returning the heaviest classes first. This is the quickest way to understand how big and how 'shaped' a place is — e.g. tens of thousands of Parts, a forest of UI Frames, a swarm of scripts, or an unusual pile of a single odd class. The descendant walk is capped (maxScan, default 200000) and sets truncated=true if it hits the cap (the counts then reflect only what was scanned). The returned class list is capped to topN entries. Requires nothing beyond a live game; everything is guarded. Returns { totalInstances, scanned, truncated, distinctClasses, topClasses: [{ class, count }] } (sorted by count desc) or { error }. Signature: { topN: any?, maxScan: any?, threadContext: number? }. Phase: observe; cost=medium; idempotency=read-only. Requires: active-client. Produces: structured-observation, diagnostic-report. Safety: read-only. On failure: inspect tool-schema for exact fields, defaults, constraints, and an invocation example.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| topN | No | How many of the heaviest ClassName buckets to return, sorted by count descending (default 25). The full distinctClasses count is always reported even when the list is trimmed to topN. | |
| maxScan | No | Maximum number of descendants to visit (default 200000). The walk stops at this cap and sets truncated=true; raise it for a huge place if you need exact totals, lower it to bound cost. | |
| threadContext | No | Optional Roblox thread identity for this call; omit it to use the server default. |