Skip to main content
Glama

spawn_exec

Run read-only JavaScript snippets to query live game objects and inspect their state in the active room. Requires a live player connection.

Instructions

Run a read-only JavaScript snippet against the live room (e.g. query objects, read an object's state). Pushing is the only write path. Needs a LIVE ROOM — rooms exist only while a player is connected, so open spawn_play_open first or you get a 5xx. api.sql is NOT available here at all (the endpoint is read-only server-side and refuses SQL outright, even SELECT) — there is no way to read the game database through this server.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
scriptYesJS to eval in the live room, e.g. return api.query({}).slice(0,50).map(o => ({id:o.id, pos:o.feetPosition, tags:o.tags}))
projectDirNoAbsolute path to the Spawn game project (game.json / .env). Defaults to SPAWN_PROJECT_DIR or the MCP process cwd.
Behavior5/5

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

With no annotations, the description carries the full behavioral burden. It discloses the read-only nature, the requirement for an active room, the 5xx error condition, and the server-side refusal of SQL. This goes beyond the schema and annotations, giving the agent a complete picture of expected behavior.

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 action ('Run a read-only JavaScript snippet') and then provides essential caveats in a tight three-sentence structure. Every sentence adds unique and necessary information, with no filler or 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?

The description thoroughly covers prerequisites, restrictions, and error conditions, making it highly actionable. The only minor gap is that it doesn't explicitly describe the return value format, but since the tool is an evaluator, the return is implicitly the script's result. This is a small omission given the otherwise comprehensive context.

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 thorough descriptions for both parameters, including an example for the script. The description adds the critical constraint that api.sql is not available, which directly influences what the script parameter can contain. This adds value beyond the schema's 100% coverage.

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's purpose: 'Run a read-only JavaScript snippet against the live room' with concrete examples like 'query objects, read an object's state'. It distinguishes itself from write tools by noting 'Pushing is the only write path', and from database access by explicitly excluding api.sql.

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?

Usage is explicitly tied to a live room: 'open spawn_play_open first or you get a 5xx' directly references the prerequisite and alternative. It also states when not to use it: for any database access, since api.sql is unavailable. This provides clear when-to-use and when-not-to-use guidance.

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