spawn_play_eval
Evaluate JavaScript in the play page's top frame for browser diagnostics: WebGPU support, network state, document title. Can't reach game UI; use spawn_play_input and spawn_exec.
Instructions
Evaluate JavaScript in the play page's TOP frame (browser context — not the Spawn room api). Use it for page-level diagnostics: WebGPU support, network state, document title. It CANNOT see or click the game's UI: Spawn renders the UI in a cross-origin sandboxed iframe, so document.querySelector finds none of your ui.js buttons and reaching into the frame throws. Click game UI with spawn_play_input coordinates instead, and read live world state with spawn_exec.
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": {
"script": "<script>"
},
"name": "spawn_play_eval"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| script | Yes | A JS EXPRESSION evaluated in the page's top frame (not a function body — a bare `return` is a syntax error). Wrap statements in an IIFE: (() => { ...; return x; })() |