Skip to main content
Glama

eval

Run JavaScript in the open three.js page to inspect the scene, test changes, measure imported or procedural geometry, and return JSON results with console logs and errors.

Instructions

Runs JavaScript in the open page and returns what it returns, as JSON, then up to 5 lines it logged (console.log, warn, info) and up to 5 console errors. In scope: scene, camera, renderer, find(name), stats(target) (vertices, triangles, bounds, closed, volume, genus per mesh), realNow(), window, and THREE on a page that loads three through an import map. performance.now, Date and timers run on the harness's paused clock (code that awaits a timer or frame steps it until done), so to time code here use realNow() (real milliseconds), and end GPU work before reading it (a 1-pixel gl.readPixels; on WebGPU, await renderer.backend.device.queue.onSubmittedWorkDone()). Use it to inspect the scene, try a change before writing it into the source, measure an imported model, or check procedural geometry with stats after each step; changes vanish on reload. A thrown error names where it threw: a line of this code or of the page's own files. Code that keeps the page busy for 30 s (longer on a busy host) is stopped and the page kept: split long work across calls, or await a 0 ms timer every few hundred iterations.

Input Schema

NameRequiredDescriptionDefault
codeYesThe body of an async function; return the value to see.
gameNoThe name the game was opened under with the `open` tool, to act on ("main" by default; a subagent uses its own).
saveNoWrite what the code returns (an ArrayBuffer, typed array, Blob, canvas or data URL) to this path under cwd, e.g. assets/baked.glb or data/mask.png, and reply with its size instead of the bytes: baked geometry, a painted canvas, measured tables.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.1

TDQS

A4.6/5.0
Behavior5/5

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

With no annotations, the description carries the full load and does so: return shape (JSON value, up to 5 log lines, <5 errors), the 30 s runaway guard and 'page kept' outcome, and the requirement to split long work or yield with a 0 ms timer. It also discloses non-obvious clock semantics (performance.now/Date/timers on a paused clock, use realNow()) and that GPU work must be drained before reading.

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 what the tool returns, then scope, then timing caveats, then limits — a sensible order with no filler sentences. It is a dense, clause-heavy block that would scan faster as short lines, but nearly every clause carries operational information.

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 and no annotations, yet the description covers return format, error reporting, timeouts, clock behavior, GPU synchronization, and the available globals — everything an agent needs to invoke it without surprises. Nothing material is deferred to structured fields that don't exist.

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 all three params are already documented; the description nonetheless adds real meaning to `code` by describing it as an async body, explaining that awaiting a timer or frame steps the paused clock, and warning that thrown errors report a line. It says nothing extra about `game` or `save`, which the schema handles alone.

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?

Names a specific verb and resource: runs JavaScript in the open page and returns the result as JSON plus bounded console output. The scope list (scene, camera, renderer, stats, realNow, THREE) and the 'inspect the scene / try a change / measure a model' phrasing make it unmistakable against siblings like observe or model_audit.

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 four concrete use cases (inspect the scene, prototype a change, measure an imported model, check procedural geometry with stats) and notes changes vanish on reload, which frames it as a scratch/test tool. It falls short of explicitly naming when NOT to use it or which sibling to prefer for read-only observation.

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