Skip to main content
Glama

Run a rover program

run_program

Execute JavaScript to control rover motion, read sensors, manage head/face, and start simulations; returns immediately, so poll status and console output.

Instructions

Run JavaScript on the robot with the rover library (same as the Code page; it replaces any running program and starts the simulation). Top-level await works. Motion (await): rover.forward(s), backward(s), turn(deg), left(s), right(s); rover.drive(speed −1…1, turn °/s) keeps going; rover.stop(); rover.power(%). Readings (sync, 50 ms snapshots): rover.read(id), sensors(), distance() (nearest sonar/IR cm), light() (%), bumped(), pose(), time(). Head/face: await rover.head(deg), trackLight(on), headAngle(); rover.face(emotion, text), say(text, s). Buttons: pressed(id), onButton([id], fn(event)), await waitButton([id]). Time/output: await wait(s), await rover.until(fn, timeout), log(...). Customise: await rover.module(name, on), addSensor({type,name,x,y,angle,range}), updateSensor(id, fields), removeSensor(id), sensorList(). Returns immediately; poll get_program for status and the console.

Input Schema

NameRequiredDescriptionDefault
codeYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.1.1

TDQS

A4.3/5.0
Behavior5/5

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

Discloses the critical side effects beyond annotations: it 'replaces any running program and starts the simulation', returns immediately rather than blocking, and status/console must be retrieved via get_program. That is exactly the destructive-and-async context an agent needs and it is consistent with readOnlyHint=false.

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 purpose and side effects before the reference dump, and the API list is grouped by concern (motion, readings, head, buttons, time, customisation) with terse notation. It is long, but nearly every token is load-bearing API signature; a slightly more scannable grouping would push it higher.

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 no-output-schema mutation tool it covers the essentials: what it does to the world, return-immediately semantics, and where to read status and console output. Missing are failure modes (syntax/runtime errors), the code length ceiling, and any concurrency/permission caveats.

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 single `code` parameter is the entire payload, and the description effectively documents its contents by cataloguing the full `rover` API, including async-vs-sync distinctions and that top-level await works. Schema coverage is 0%, but the description compensates well; the only gap is that the 20000-char limit and error behavior are not mentioned.

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?

States a specific verb and resource ('Run JavaScript on the robot with the `rover` library') and immediately anchors it to a known concept ('same as the Code page'). The API surface listed in the description makes clear this is the programmable-batch alternative to the granular movement/display siblings (drive, turn, set_head), so an agent can tell them apart without opening a schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It implies when to use it via 'same as the Code page' and tells the agent what to do afterwards ('poll get_program for status'), but never explicitly contrasts with siblings like drive, turn, stop_program, or set_head. An agent must infer that this is the batch/scripted route rather than the single-command route.

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