Skip to main content
Glama

Run steps and watch the scene

three_play

Runs a three.js page headless, executes interaction steps, watches live scene values after each frame, and validates expect claims with errors and a screenshot.

Instructions

Prove that a change does what it should. Open the page headless, run steps (click, press, hold, drag, wheel, wait, frames, eval, until) and read watch expressions in the live scene after every frame and step, with scene, camera, renderer, info (renderer.info), $('name') and $$('Type') in scope (window globals such as app work too). expect claims are judged at the end, at any moment or at every frame, each pass or fail with its value, time, frame and step. Watched values come back only where they changed. Also page and console errors with explanations, and a screenshot. When it passes, keep it with three_scenario op save.

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>"
    },
    "name": "three_play"
  }
}

Input Schema

NameRequiredDescriptionDefault
rootNofolder to serve when the page needs files above its own folder
waitNoms to let the scene run before the first step (default 1000)
entryNo
stepsNoSteps 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}.
watchNoJS expressions to follow, e.g. $('player').position, info.render.calls
widthNo
expectNoClaims about the scene: "$('player').position.y > 1 @ end", "any: $('door').rotation.y > 1", "always: info.render.calls < 200", "x @ step 2", or {js, at}.
heightNo
ignoreNo
targetYesFolder with the page (index.html), or the http(s) URL of a running dev server.
webgpuNo
sample_msNo
screenshotNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.0

TDQS

A4.3/5.0
Behavior4/5

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

Goes well beyond the annotations by disclosing the execution model: headless page, ordered interactive steps, per-frame/per-step sampling, and a returned payload of changed watched values, expect verdicts with value/time/frame/step, page and console errors, and a screenshot. It leaves unstated the cost/runtime profile of launching a browser and the fact that eval/click steps can mutate page state, which is why readOnlyHint is false.

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-loads the goal, then the mechanism, then the outputs, then the follow-up — a logical order with no filler sentences. The long parenthetical of step types is dense but earns its space as the primary usage reference.

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

Completeness4/5

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

For a complex, 13-parameter, no-output-schema tool, the description covers the return shape (changed-only watch values, expect results, errors, screenshot) and the core execution model well. Remaining gaps are the undocumented secondary parameters and what a failed run's top-level result looks like.

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?

With 46% schema coverage across 13 parameters, the description compensates for the hardest ones: it enumerates the step types (click, press, hold, drag, wheel, wait, wait-for, frames, eval, until), names the scope available to `watch` and `expect` (scene, camera, renderer, info, $('name'), $$('Type'), window globals), and explains the `at` forms end/any/always/step N. Several parameters (root, width, height, ignore, sample_ms, webgpu, entry) get no mention in either place.

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+resource: open the page headless, run steps, read `watch` expressions, judge `expect` claims. It reads as a scripted browser-driven verification harness, clearly distinct from siblings like three_page or three_scenario, and names three_scenario as the persistence path.

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?

"Prove that a change does what it should" frames the use case clearly, and the closing line routes the agent to three_scenario op save when the run passes. It does not state when to prefer alternatives (e.g. three_check vs three_page) or when not to use it, so it stops short of full routing guidance.

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