Skip to main content
Glama

interact

Play scripted page steps frame by frame to verify state changes, console output, motion, and sound; attach expected checks and save passing runs as rerunnable tests.

Instructions

Plays steps on the open page frame by frame and returns what changed in the state (the whole state when nothing did), the console lines and errors the steps raised, a Motion line when the subject turned or stopped under a held key or would stutter on a 100 Hz screen, and a Sound line on a page that makes sound. Each mouse and touch step names the object under it and its distance. expect adds one ✓ or ✗ line per path; save keeps the play as a check test reruns, only when every entry holds. A malformed step fails the call before anything plays; a failing expect entry is reported, not raised. Use feel to measure how an event reacts on screen, observe to read the state without playing, and eval to set it with code. Options in full: the skill's references/tools.md.

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": "interact"
  }
}

Input Schema

NameRequiredDescriptionDefault
gameNoThe name the game was opened under with the `open` tool, to act on ("main" by default; a subagent uses its own).
lookNoAlso return `look`'s picture after the steps.
saveNoSave the steps and `expect` as a check of this name (letters, digits, - or _) in game-tests.json when every Expect entry holds; the call plays from a fresh reload, its leading state steps as setup.
hoverNoAfter the steps, the mouse moves to each named object's centre; one diff per name after `frames`.
stepsNoSteps, in order: { key, frames? } (held, then released); { key, down: true|false } (held across steps); { mouse: click|dblclick|down|up|move, x, y, button?: "left"|"right"|"middle" } (left by default); { mouse: move, relative: [dx, dy] } (pointer lock); { wheel: deltaY, x?, y? }; { resize: [w, h] }; { scroll: px | { progress: 0..1 } | { to: "#id" } }; { touch: start|move|end|tap, x, y }; { wait: frames, draw? }; { action, ...args } (window.__game.act); { state: {...} } (window.__game.setState, then one frame); { until: {...}, max? } (until the state holds, values as `expect`'s; `max` 600 frames by default); { clock: { timescale?, paused? } } (paused: false plays in real time; the clock reads 60 s at frame 0 on purpose). Each step advances `frames` (default 1) and draws only its last (draw: true draws each); `frames: 0` sends it on the same frame as the next.
traceNoUp to 6 dotted paths into observe(), read each frame (the first 600): first and last value, peak or low, and first change, with frames.
expectNoChecked against the state after the steps, keyed by dotted paths into observe() ("coins.0.x"): a number, string or boolean (equal), [min, max] (a range; two numbers always are), a list of other values (one of them; [null] is null), [] (an empty list) or null (exists, whatever its value).
framesNoFrames to wait at each hovered object (default 1).
recordNotrue: plays the steps in real time (1/60 s a frame, 15 s at most) into a GIF in the run folder; the reply has four moments and the real frame intervals.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changedv0.4.5
    • changedInput schema / properties / expect / description
      Previous value: -"Checked against the state after the steps, in this reply: { score: 1, \"player.x\": [2.9, 3.1] } gives `Expect: score 1 ✓ · player.x 2.97 ✗ expected 2.9 to 3.1`. A value is a number, string or boolean (equal), [min, max] (a range; two numbers are always a range), a list of other values (one of them, as [\"banana\", \"star\"]) or null (exists), keyed by dotted paths into observe() (\"coins.0.x\" for lists)."New value: +"Checked against the state after the steps, keyed by dotted paths into observe() (\"coins.0.x\"): a number, string or boolean (equal), [min, max] (a range; two numbers always are), a list of other values (one of them; [null] is null), [] (an empty list) or null (exists, whatever its value)."
    • changedInput schema / properties / hover / description
      Previous value: -"After the steps, move the mouse to each named object's centre on screen and return what changed there after `frames`, one diff per name."New value: +"After the steps, the mouse moves to each named object's centre; one diff per name after `frames`."
    • changedInput schema / properties / record / description
      Previous value: -"true: play the steps (after leading { state } steps) in real time, each frame 1/60 s, and record them: a GIF in the run folder (480 px, each frame shown for its real time, HTML over the canvas included) and four moments of it in the reply, with the game's real frame intervals at a 60 Hz pace (median, p95, max; a slower frame reads as its own time, not a 60 Hz screen's 33 ms) on the GPU named; with look: true, look's picture too. 15 s at most; the clock is paused again after. Evidence of real-time play for an agent or a judge."New value: +"true: plays the steps in real time (1/60 s a frame, 15 s at most) into a GIF in the run folder; the reply has four moments and the real frame intervals."
    • changedInput schema / properties / save / description
      Previous value: -"Save this call (its steps and `expect`, which it needs) as a check of this name in game-tests.json when every Expect entry holds. A call with `save` plays its steps from a fresh reload, as `test` and the after-edit hook will rerun them: leading state steps become its setup."New value: +"Save the steps and `expect` as a check of this name (letters, digits, - or _) in game-tests.json when every Expect entry holds; the call plays from a fresh reload, its leading state steps as setup."
    • changedInput schema / properties / steps / description
      Previous value: -"Steps, in order. { key, frames? } presses the key, holds it `frames` frames (default 1) and releases it; { key, down: true } holds it across steps until { key, down: false }; { mouse: click|dblclick|down|up|move, x, y }; { mouse: move, relative: [dx, dy] } (mouse look under pointer lock); { wheel: deltaY, x?, y? }; { resize: [w, h] }; { scroll: px | { progress: 0..1 } | { to: \"#section\" } } (scrolls the window; the reply says where, and the progress of Lenis, ScrollTrigger or drei ScrollControls when found); { touch: start|move|end|tap, x, y }; { wait: frames, draw? }; { action, ...args } for window.__game.act; { state: {...} } (sets observe()'s keys through window.__game.setState, then draws a frame: set the scene up first, as { state: { player: { x: 2, z: 0 } } }); { until: {...}, max? } (steps one frame at a time until the state holds, at most `max` frames, 600 by default, and says the frame or what it saw; its values as `expect`'s); { clock: { timescale?, paused? } } (sets the clock's time scale, or resumes (paused: false) or pauses real-time play; the clock reads 60 s at frame 0 on purpose, past any boot, so a page's own time starts there). A step's frames run without drawing except its last (an until draws none); draw: true on a step draws every frame, for a picture that builds up over frames (trails, progressive rendering). Each other step advances `frames` (default 1); `frames: 0` sends it on the same frame as the next step (two keys down at once, for a diagonal)."New value: +"Steps, in order: { key, frames? } (held, then released); { key, down: true|false } (held across steps); { mouse: click|dblclick|down|up|move, x, y, button?: \"left\"|\"right\"|\"middle\" } (left by default); { mouse: move, relative: [dx, dy] } (pointer lock); { wheel: deltaY, x?, y? }; { resize: [w, h] }; { scroll: px | { progress: 0..1 } | { to: \"#id\" } }; { touch: start|move|end|tap, x, y }; { wait: frames, draw? }; { action, ...args } (window.__game.act); { state: {...} } (window.__game.setState, then one frame); { until: {...}, max? } (until the state holds, values as `expect`'s; `max` 600 frames by default); { clock: { timescale?, paused? } } (paused: false plays in real time; the clock reads 60 s at frame 0 on purpose). Each step advances `frames` (default 1) and draws only its last (draw: true draws each); `frames: 0` sends it on the same frame as the next."
    • changedInput schema / properties / trace / description
      Previous value: -"Up to 6 dotted paths into observe() read every frame of the steps (after leading state steps): one line per path with its first and last value, its peak or low and their frames, and the first frame it changed, as `player.y: 0 → peak 2.04 at frame 22 → 0 at frame 44; first changed at frame 2`. Tune by numbers: jump height and airtime, stopping distance, frames from key to motion. Read for the first 600 frames of the steps; a longer run keeps those."New value: +"Up to 6 dotted paths into observe(), read each frame (the first 600): first and last value, peak or low, and first change, with frames."
  2. First observedv0.2.1

TDQS

A4.4/5.0
Behavior4/5

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

Annotations only declare readOnlyHint=false and openWorldHint=true, so the description carries most of the weight and does so: a malformed step fails the call before anything plays, a failing `expect` entry is reported rather than raised, `record` plays in real time at 1/60 s per frame for at most 15 s, and `until` defaults to a 600-frame cap. What is not disclosed is whether `save` writes to disk persistently or what happens to an existing check of the same name — a meaningful omission for a mutating, open-world tool.

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?

It is front-loaded with the core action and the return surface, and every sentence carries new information; nothing is filler. The cost is density — the middle sentences are long run-ons packed with nested clauses ('a Motion line when the subject turned or stopped under a held key or would stutter on a 100 Hz screen'), which is harder to parse than a short bulleted return list would be, though the closing pointer to references/tools.md correctly stops it from bloating further.

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?

For a 9-parameter tool with a nested step DSL and no output schema, the description supplies both the input model and the shape of the reply, so the absence of an output schema costs nothing. Failure modes, defaults, and time bounds are all stated, which is what an agent needs before issuing a multi-step, state-mutating play.

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% and the per-parameter descriptions already spell out the step DSL, `expect` matching rules, and the `until`/`clock` semantics in more detail than the prose does. The description adds meaning mainly on the result side (one ✓/✗ line per `expect` path, steps replayed from a fresh reload with leading state steps as setup) rather than on the inputs themselves, so the baseline 3 is correct.

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?

The opening states a specific verb and resource — plays `steps` on the open page frame by frame — and enumerates exactly what comes back: the state diff, console lines and errors, a Motion line, a Sound line. It also names the siblings it is not (`feel`, `observe`, `eval`) with the condition that selects each, so an agent can disambiguate without opening any schema.

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?

The definition routes explicitly: `feel` to measure how an event reacts on screen, `observe` to read state without playing, `eval` to set it with code. It also states a decision rule inside the tool itself — `save` only persists when every `expect` entry holds — and defers the remaining options to references/tools.md rather than leaving gaps.

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