Skip to main content
Glama

set_speed

Set a locomotive's speed as a percentage of its maximum, with optional direction change. Returns actual speed matched to the roster's throttle limit.

Instructions

Set a locomotive's speed as a percentage of its maximum (0-100%).

Args: address: DCC address. Auto-acquires the throttle if needed. speed_percent: 0-100, clamped not rejected. direction: Optional "forward"/"reverse" (case-insensitive) — set together with speed_percent atomically ("avance à 40%") instead of a separate set_direction call. Omit to leave direction untouched. Flips instantly; for a ramped flip use set_speed_ramped instead.

Returns actual speed as % of THIS loco's own configured maximum (roster "Throttle Speed Limit"), matching PanelPro's slider, not the raw decoder ceiling. Includes "direction" only when passed, "system" (command-station name) only when non-default.

Use stop (0%) or emergency_stop (panic) rather than speed_percent=0. For a DURATION use set_speed_ramped(hold_seconds=...) — this tool is immediate only.

No-op (no error, no write) if requested speed already matches current — JMRI sends no confirmation for a redundant command.

Exhibition mode overrides speed_percent/direction with a fixed moderate forward speed — see enter_exhibition_mode.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
addressYes
directionNo
speed_percentYes
Behavior5/5

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

With no annotations, the description fully discloses behavior: auto-acquires throttle, clamps speed, no-op on redundant commands, exhibition override, and return value details (actual speed as % of loco's max, includes direction/system conditionally).

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?

Well-structured with clear Args/Returns sections, but slightly lengthy. However, every sentence provides necessary detail without redundancy. Minor opportunity to tighten.

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?

Despite no output schema and no annotations, the description covers all behavioral aspects, edge cases (clamping, no-op, exhibition mode), and return value structure. Fully compensates for missing structured fields.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema has 0% description coverage, but the description adds extensive meaning: address (auto-acquires), speed_percent (0-100, clamped), direction (optional, case-insensitive, atomic set, leaves untouched if omitted, flips instantly). Also explains return value details for parameters.

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 it sets a locomotive's speed as a percentage, distinguishing it from siblings like set_speed_ramped, emergency_stop, stop, and set_direction. It covers automatic throttle acquisition and atomic direction setting.

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?

Explicitly advises using stop or emergency_stop instead of speed_percent=0, recommends set_speed_ramped for duration or ramped direction changes, and notes exhibition mode override. Provides clear when-to-use and alternatives.

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/HO44-PROJECT/MrJ-JMRI-MCP'

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