Skip to main content
Glama

set_power

Control model railroad track power by turning it ON or OFF, with state verification to confirm the command was applied correctly. Avoids redundant commands to prevent system errors.

Instructions

Turn a DCC system's power ON or OFF, and report the state actually observed.

Args: system: System name, prefix, or fragment (e.g. "ohara", "O"). Case-insensitive. Omit to use JMRI's default system. turn_on: True to turn power ON, False to turn it OFF.

This writes to JMRI. The reported state is re-read ~1s after the command (JMRI's immediate POST response is transient/unreliable) — if the observed state doesn't match the request, "confirmed" will be false and the caller should say so honestly rather than assume success.

Safe to call repeatedly with the same turn_on value, including right after another call already set that state: current state is always checked first, and nothing is sent to JMRI if it already matches the request — re-POSTing a state JMRI already reports is a real bug (JMRI/JMRI#15279) that knocks the system into UNKNOWN. JMRI 5.17.1+ self-recovers from that within seconds; older JMRI doesn't, so this result may include "outdated_jmri_version" — tell the user to upgrade JMRI rather than expect this to self-heal.

In exhibition mode, turn_on=True is REFUSED (returns an error, power stays off) — turn_on=False (an emergency power cut) always still works. See enter_exhibition_mode.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
systemYes
turn_onYes
Behavior5/5

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

With no annotations provided, the description carries the full burden. It discloses that it writes to JMRI, checks current state before sending, re-reads after 1 second for confirmation, the possibility of false confirmed, the bug with re-POSTing, exhibition mode behavior, and potential outdated JMRI version issues. This is highly transparent.

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?

The description is well-structured with paragraphs for arguments, behavior, safe calling, and exhibition mode. While every sentence adds value, it is slightly verbose. However, the structure aids readability.

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?

Given two parameters and no output schema, the description covers behavior, edge cases (exhibition mode, JMRI bug), error conditions (outdated version), and the nature of the return (confirmed flag). It is sufficiently complete.

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 coverage is 0%, but the description adds significant meaning: for 'system', it explains it can be a name, prefix, or fragment, is case-insensitive, and can be omitted for default. For 'turn_on', it clarifies True/False meanings. This exceeds what the schema provides.

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 'Turn a DCC system's power ON or OFF, and report the state actually observed.' This is a specific verb+resource combination. It distinguishes itself from siblings like get_power (read-only) and power_off_all/power_on_all (apply to all systems).

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

Usage Guidelines4/5

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

The description provides clear context for when to use the tool (to control power for a specific system) and notes special cases like exhibition mode where turn_on=True is refused. It also mentions safe repeated calling. However, it does not explicitly exclude usage when other tools like power_off_all might be more appropriate.

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