Skip to main content
Glama
Roblox Studio MCP

Roblox Studio MCP

Performance and memory

performance
Read-onlyIdempotent

Diagnose why a Roblox place is heavy by reading frame, memory, draw-call, script-CPU, coverage, scene, and broken-asset data, then profile running scripts and capture frame spikes.

Instructions

Reads the engine's own counters, and can run the script profiler.

snapshot returns what the Developer Console shows: frame, physics and render times in milliseconds, instance and part counts, draw calls, network rates, and memory broken down by category. Use it to answer 'why is this place heavy' with numbers instead of guesses.

profile runs Studio's script profiler — the Script Performance window — for seconds and reports which scripts consumed CPU. It blocks for that long, so keep it short. It only sees code that actually runs, so start a playtest first; profiling an idle edit session returns nothing.

microprofile is the MicroProfiler: it captures the last frames frames and ranks the engine scopes that filled them — physics, rendering, replication, GC, scripts — by self time, on every CPU thread, plus frame time p50/p95/max and what filled the worst frame. Use it for a frame-time spike that profile cannot explain, because most spikes are not Luau. The profiler is process-wide, so in Studio it includes Studio's own UI work; play first to measure the game. export saves the capture as an .x.html file the MicroProfiler viewer opens. Same frames, compared before and after a change, is the way to prove a fix.

coverage reports which lines of which scripts actually executed — dead code, untested branches, whether a fix was even reached. Pass enable first, then play, then read the coverage back FROM THE PLAYTEST session, not the editor: instrumenting is per data model, and the playtest is a different one. enable is remembered for the place and re-applied by each new session as it loads. Pass an empty enable array to stop.

What it can and cannot see: instrumentation is fixed when a script is first compiled, so it measures modules required after that point — where most game logic lives — but never a script that starts with the place, which the data model compiles before any plugin exists. Those report 0 lines and are named as unmeasurable rather than counted as dead code.

scene breaks the place down by what it is actually made of: instances by category, triangles and draw calls FOR WHAT THE CAMERA CAN SEE, and the assets holding script, animation and audio memory — each named, so "2.4GB of memory" becomes "this animation is 138KB and these are the Animators using it". It also reports UNPARENTED INSTANCES, which is the closest thing here to a leak detector: objects still alive with nothing holding them in the tree, invisible to find and to tree because they are in neither.

The triangle and draw-call section is the one number here that depends on where the camera is pointing, and it moves enormously: the same place measured 332 triangles looking at empty sky and 29,060 looking at 1,800 parts, seconds apart. So it answers "how heavy is this view", not "how heavy is this place" — point the camera first with viewport op="focus", and compare two views only if both were framed the same way.

audit is a health check rather than a performance one: it finds every reference in the place that points at NOTHING. A Sound whose id was deleted or made private plays silence, a Decal shows nothing, an Animation does nothing — none of them errors, none warns, and the instance looks perfectly healthy because the id is still a string. The only other way to find them is to play the game and notice something missing. It also reports ids left blank, scripts left Disabled, and same-named siblings, which is what makes WaitForChild return the wrong one.

audit fetches the assets to test them, so Studio's Output window will show load errors for the dead ones. That is the engine confirming the finding, not a fault in the tool.

Frame and network figures are only meaningful while something is running. Instance counts and memory are useful in edit mode too.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "performance"
  }
}

Input Schema

NameRequiredDescriptionDefault
opNo'snapshot' reads counters now; 'profile' samples running scripts; 'microprofile' captures MicroProfiler frames (engine scopes on every thread); 'coverage' reports which lines have executed; 'scene' breaks the place down by what it is made of; 'audit' finds broken asset references and other silent faults.snapshot
topNomicroprofile only: scopes to list.
sortNomicroprofile only: rank by self time (where work happened) or total (including children).self
enableNocoverage only: scripts to start measuring. Remembered for this place and switched on by every session that loads afterwards, so a playtest instruments them before its scripts run. An empty array stops instrumenting.
exportNomicroprofile only: also save the capture as an .x.html file and return its path.
filterNomicroprofile only: keep scopes whose name or group contains this, e.g. "Physics" or "Script".
framesNomicroprofile only: how many recent frames to capture.
playerNoclient only: player name; required with multiple players.
targetNoclient: read the actual player's playtest VM. Use the playtest server studioId.studio
threadNomicroprofile only: walk only threads whose name contains this, e.g. "RBX Main".
secondsNoprofile only: how long to sample. The call blocks for this long.
sectionNoscene only: return just one section instead of all six.
studioIdNoTarget Studio; omit for the active one.
frequencyNoprofile only: samples per second. Higher is more precise and costlier.
includeIdleNomicroprofile only: keep Sleep/Wait scopes, hidden by default because they are the absence of work.
keepRunningNomicroprofile only: leave the MicroProfiler on afterwards instead of switching it off.
includePluginsNoprofile only: include Studio plugins in the results. Off by default — an idle Studio is mostly plugin activity, which buries the place's own scripts.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed10 schema fields changedv1.0.5
    • addedInput schema / properties / export
      Added value: +{
      +  "default": false,
      +  "description": "microprofile only: also save the capture as an .x.html file and return its path.",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / filter
      Added value: +{
      +  "description": "microprofile only: keep scopes whose name or group contains this, e.g. \"Physics\" or \"Script\".",
      +  "type": "string"
      +}
    • addedInput schema / properties / frames
      Added value: +{
      +  "default": 64,
      +  "description": "microprofile only: how many recent frames to capture.",
      +  "maximum": 256,
      +  "minimum": 4,
      +  "type": "integer"
      +}
    • addedInput schema / properties / includeIdle
      Added value: +{
      +  "default": false,
      +  "description": "microprofile only: keep Sleep/Wait scopes, hidden by default because they are the absence of work.",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / keepRunning
      Added value: +{
      +  "default": false,
      +  "description": "microprofile only: leave the MicroProfiler on afterwards instead of switching it off.",
      +  "type": "boolean"
      +}
    • changedInput schema / properties / op / description
      Previous value: -"'snapshot' reads counters now; 'profile' samples running scripts; 'coverage' reports which lines have executed; 'scene' breaks the place down by what it is made of; 'audit' finds broken asset references and other silent faults."New value: +"'snapshot' reads counters now; 'profile' samples running scripts; 'microprofile' captures MicroProfiler frames (engine scopes on every thread); 'coverage' reports which lines have executed; 'scene' breaks the place down by what it is made of; 'audit' finds broken asset references and other silent faults."
    • changedInput schema / properties / op / enum
      Previous value: -[
      -  "snapshot",
      -  "profile",
      -  "coverage",
      -  "scene",
      -  "audit"
      -]New value: +[
      +  "snapshot",
      +  "profile",
      +  "microprofile",
      +  "coverage",
      +  "scene",
      +  "audit"
      +]
    • addedInput schema / properties / sort
      Added value: +{
      +  "default": "self",
      +  "description": "microprofile only: rank by self time (where work happened) or total (including children).",
      +  "enum": [
      +    "self",
      +    "total"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / thread
      Added value: +{
      +  "description": "microprofile only: walk only threads whose name contains this, e.g. \"RBX Main\".",
      +  "type": "string"
      +}
    • addedInput schema / properties / top
      Added value: +{
      +  "default": 20,
      +  "description": "microprofile only: scopes to list.",
      +  "maximum": 60,
      +  "minimum": 1,
      +  "type": "integer"
      +}
  2. Changed2 schema fields changedv0.9.1
    • addedInput schema / properties / player
      Added value: +{
      +  "description": "client only: player name; required with multiple players.",
      +  "type": "string"
      +}
    • addedInput schema / properties / target
      Added value: +{
      +  "default": "studio",
      +  "description": "client: read the actual player's playtest VM. Use the playtest server studioId.",
      +  "enum": [
      +    "studio",
      +    "client"
      +  ],
      +  "type": "string"
      +}
  3. Changed2 schema fields changedv0.6.5
    • changedInput schema / properties / op / description
      Previous value: -"'snapshot' reads counters now; 'profile' samples running scripts; 'coverage' reports which lines have executed; 'scene' breaks the place down by what it is made of."New value: +"'snapshot' reads counters now; 'profile' samples running scripts; 'coverage' reports which lines have executed; 'scene' breaks the place down by what it is made of; 'audit' finds broken asset references and other silent faults."
    • changedInput schema / properties / op / enum
      Previous value: -[
      -  "snapshot",
      -  "profile",
      -  "coverage",
      -  "scene"
      -]New value: +[
      +  "snapshot",
      +  "profile",
      +  "coverage",
      +  "scene",
      +  "audit"
      +]
  4. First observedv0.1.8

TDQS

A4.8/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With annotations already declaring readOnly/idempotent/non-destructive, the description still adds substantial undisclosed behavior: `profile` blocks for `seconds`, the MicroProfiler is process-wide and therefore includes Studio's own UI work, instrumentation is fixed at script compile time so place-start scripts report 0 lines, and `enable` persists for the place and is re-applied to each new session. It also pre-explains an alarming side effect ('Studio's Output window will show load errors ... the engine confirming the finding, not a fault in the tool') and notes `export` writes an .x.html artifact — the only mild tension with readOnlyHint, but it is disclosed rather than hidden.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Well structured — one paragraph per op, each opening with the op name in backticks, followed by caveats, so an agent can skim to the relevant block. The length is justified by 17 parameters and 6 distinct operations, but there is editorial filler ('with numbers instead of guesses', 'the way to prove a fix', the 332-vs-29,060 anecdote) that a tighter definition could compress.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

No output schema exists, so the description carries the return-value burden and does so for every op — snapshot names the exact metrics returned, microprofile names self time, p50/p95/max and worst-frame attribution, scene enumerates its six sections, coverage describes executed-line reporting and unmeasurable scripts. For a 17-parameter, 6-op tool the only remaining gap is that peripheral parameters go unmentioned, which the schema covers.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the schema already carries per-parameter documentation and this sits at a 3 baseline. The description rises above it by adding cross-parameter meaning the schema cannot: `seconds` blocks the call, `frames` captures recent frames, `enable` must precede the playtest and an empty array stops it, and `export` produces a viewer-openable file. It does not cover the more peripheral knobs (`thread`, `includeIdle`, `keepRunning`, `filter`, `includePlugins`), which is why it stops short of 5.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Opens with a specific verb+resource ('Reads the engine's own counters, and can run the script profiler') and then defines each of the six ops by what it measures and what it answers ('why is this place heavy', 'which scripts consumed CPU', 'which lines actually executed'). No sibling tool overlaps — `debug`, `console`, and `playtest` are clearly different, and the description makes the boundary implicit through its measurement framing.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives explicit when-to-use for every op plus exclusions: microprofile is for 'a frame-time spike that `profile` cannot explain, because most spikes are not Luau'; profile requires a playtest first because 'profiling an idle edit session returns nothing'; coverage must be read from the playtest data model, not the editor. It even routes to a sibling ('point the camera first with `viewport op="focus"`') and states when figures are meaningless ('only meaningful while something is running').

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.