Skip to main content
Glama

spawn_play_eval

Evaluate JavaScript in the play page's top frame to diagnose page-level issues like WebGPU support, network state, or document title. Does not access game UI inside its sandboxed iframe.

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.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
scriptYesA 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; })()
Behavior5/5

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

With no annotations, the description fully carries the transparency burden. It discloses the cross-origin sandbox limitation, that reaching into the frame throws, and that the tool cannot access game UI. It also explains that the script must be an expression, not a function body, which is critical behavioral context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with the core purpose, then expands into usage scenarios, limitations, and alternatives in a compact, well-organized way. Every sentence contributes meaningful information without redundancy.

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 simple one-parameter tool with no output schema, the description comprehensively covers purpose, usage, limitations, and alternatives. The only minor gap is not explicitly stating that the expression's return value is returned to the caller, but this is reasonably inferred from 'Evaluate JavaScript'.

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?

The schema already provides 100% coverage with a detailed description of the 'script' parameter (expression vs. function body, IIFE syntax). The tool description adds contextual value by clarifying what the script can access (top frame) and the sandboxing limitations, which enriches parameter understanding beyond the schema.

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 description clearly states the tool evaluates JavaScript in the play page's top frame, distinguishing it from the Spawn room API and sibling tools like spawn_exec and spawn_play_input. It explicitly lists diagnostic use cases (WebGPU support, network state, document title), making the purpose specific and unambiguous.

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 description provides explicit when-to-use guidance (page-level diagnostics) and when-not-to-use (cannot see/click game UI). It names alternatives: spawn_play_input for clicking UI and spawn_exec for reading world state, making the usage boundaries very clear.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/wfbcargo/wfbcargo_spawn_mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server