Skip to main content
Glama
okenjioxx

Roblox Executor MCP Server

by okenjioxx

Measure Lua heap growth caused by running a snippet

measure-memory
Destructive

Measure Lua heap allocation of a snippet by comparing gcinfo() before and after execution to detect memory leaks or heavy allocations.

Instructions

Measure how much Lua heap memory a snippet allocates: read gcinfo() (the live Lua heap size in KB) immediately before running your code, run it once (compiled via loadstring, executed inside a pcall), then read gcinfo() again and report the delta. Use this to spot leaks or unexpectedly heavy allocations — e.g. confirm a function frees what it creates, see how big a table a constructor builds, or detect a snippet that balloons the heap. Caveats: gcinfo reports the WHOLE Lua heap, so concurrent game activity and garbage collection between the two samples add noise; a negative deltaKB means a GC cycle ran (it does NOT mean your code freed memory). For a cleaner reading, allocate enough to dwarf the noise or run a tight loop inside code. A compile error or a runtime error is reported in error with ok=false (the before/after samples are still returned). Requires gcinfo and loadstring (both guarded). Returns { beforeKB, afterKB, deltaKB, ok, error? } or { error }. Signature: { code: string, threadContext: number? }. Phase: act; cost=high; idempotency=contextual-write. Requires: active-client, explicit-mutation-approval, validated-source. Produces: structured-result. Verify with: assert-state. Safety: MUTATING; writes live game/client state. On failure: inspect tool-schema for exact fields, defaults, constraints, and an invocation example.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYesThe Luau snippet to measure. Compiled with loadstring and run once between two gcinfo() samples. Whatever it returns is ignored; only the change in heap size is reported. Allocate enough (or loop) so the delta stands out above background GC noise.
threadContextNoOptional Roblox thread identity for this call; omit it to use the server default.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.0.0-spies.2

TDQS

A4.4/5.0
Behavior5/5

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

Goes well beyond the annotations: explains that gcinfo measures the WHOLE heap, that concurrent activity and GC add noise, that a negative deltaKB means a GC cycle rather than freeing, and that compile/runtime errors return ok=false with samples still present. It also states the gcinfo/loadstring dependency and mutation intent, matching the destructive/mutating annotations.

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?

Core purpose and caveats are front-loaded and each sentence carries real information. However the trailing template boilerplate (Phase, cost, Requires, Produces, 'On failure: inspect tool-schema...') adds operational noise that dilutes the tight core.

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?

With no output schema, the description fully specifies the return shape ({ beforeKB, afterKB, deltaKB, ok, error? } or { error }), the error semantics, and the two-sample measurement methodology, so an agent has everything needed to invoke and interpret it.

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

Parameters3/5

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

Schema coverage is 100%, so the schema already documents code and threadContext fully. The description mirrors the schema's advice about allocating enough or looping to stand out from noise, so it adds little param-level meaning beyond the structured fields. Baseline 3 applies.

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?

States a specific verb and resource — measure Lua heap allocation of a snippet — and describes the exact mechanism (gcinfo before/after around a loadstring+pcall run). This clearly distinguishes it from generic execution siblings like execute or profile-code.

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

Usage Guidelines4/5

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

Gives concrete when-to-use scenarios: spot leaks, confirm a function frees what it creates, size a table constructor, detect heap ballooning. It lacks explicit exclusion language naming alternatives (e.g. get-memory-stats or compare-gc-snapshots), keeping it short of a 5.

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

Deploy Server

Other Tools