Skip to main content
Glama

Find what grows per cycle

three_leaks

Repeats a defined open/close cycle with garbage collection and reports per-cycle growth in GPU resources, scene objects, scenes, JS heap, and undisposed items by type to expose three.js memory leaks.

Instructions

Repeat a cycle of steps (open and close a level, add and remove objects: e.g. {"type":"eval","js":"app.load(); app.unload()"}) several times with garbage collection after each, and report what grows per cycle: GPU geometries, textures and programs, scene objects, scenes still alive, JS heap, and the resources that reached the GPU and were never disposed, by type (SphereGeometry, MeshStandardMaterial, Texture robot.png). Fails over the budget (default: no growth). Run it again after the fix to show 0 per cycle.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "target": "<target>",
      "cycle": "<cycle>"
    },
    "name": "three_leaks"
  }
}

Input Schema

NameRequiredDescriptionDefault
rootNofolder to serve when the page needs files above its own folder
waitNo
cycleYesthe steps of one cycle (same step types as three_play)
entryNo
setupNoSteps in order: {"type":"click","selector":"#start"} or {x,y}, {"type":"press","key":"Space"}, {"type":"hold","key":"ArrowRight","ms":300}, {"type":"drag","from":[x,y],"to":[x,y]}, {"type":"wheel","deltaY":200}, {"type":"wait","ms":500}, {"type":"wait-for","selector":"canvas"}, {"type":"frames","n":10}, {"type":"eval","js":"app.start()"}, {"type":"until","js":"$('ball').position.y < 0","timeout":5000}.
widthNo
budgetNogrowth allowed per cycle
cyclesNodefault 5
heightNo
ignoreNo
targetYesFolder with the page (index.html), or the http(s) URL of a running dev server.
webgpuNo
warmup_cyclesNocycles not counted (default 1)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.0

TDQS

A3.6/5.0
Behavior3/5

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

Annotations declare readOnlyHint=false, openWorldHint=true, idempotentHint=false, destructiveHint=false — it runs a browser with the user's code, which the description's mention of serving a page and eval steps is consistent with. Beyond that, the description adds useful behavior: GC after each cycle, warmup cycles excluded, budget failure semantics (default: no growth). It does not disclose timeouts, that eval runs arbitrary JS, or what a run costs.

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?

Front-loaded with the core action and the report contents, then the failure semantics and the post-fix verification. The dense parenthetical list of metrics is long but each item maps to a budget field, so it earns its space; the embedded JSON example is compact.

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

Completeness3/5

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

For a 13-parameter, nested-object tool with no output schema, the description should at least sketch the result shape — it lists the reported categories but not the structure or how to read pass/fail. Annotations cover the open-world/non-destructive profile, but agent-critical details like timeouts and whether budget failure is an error or a report are unstated.

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 54%, and the description compensates for the most important parameter by explaining cycle semantics with an example and noting cycle steps share three_play's step types. However, 11 of 13 parameters (root, entry, setup, width/height, webgpu, ignore, wait) get no mention, and budget contents/units are only partially implied by naming the metrics.

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

Purpose4/5

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

The description states a specific verb+resource: repeat a `cycle` of steps N times with GC and report what grows per cycle, enumerating the exact metrics (geometries, textures, programs, scenes, objects, heap, undisposed resources). It is clearly distinct from three_play (which runs steps once) by framing the goal as per-cycle growth detection, though it never names three_play explicitly.

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?

It gives a clear context: use before/after a memory fix, and rerun to show 0 per cycle. The cycle parameter is described as using 'same step types as three_play', which routes the agent implicitly. It does not explicitly state when not to use it (e.g. single-run playback or pure perf profiling).

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