set_light
Switch a DCC layout light on or off by name or label, then verify the actual state. Solves uncertain lighting commands by confirming whether the light truly changed as requested.
Instructions
Turn a layout light ON or OFF, and report the state actually observed.
Args: name: Light name (JMRI system name like "IL1", or its user-friendly label like "Depot Lighting") or an unambiguous fragment of the label. Case-insensitive. turn_on: True to turn the light ON, False to turn it OFF.
This is a layout light (scenery: depot, street, signal lamps, ...), distinct from a locomotive's F0 headlight function — if the user names a locomotive rather than a place/scene, use set_function or lights_on/lights_off on its DCC address instead. This writes to JMRI; the reported state is re-read after the command, and "confirmed" is honestly reported false if the observed state doesn't match what was requested (e.g. a feedback-wired light that didn't actually switch).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"name": "<name>",
"turn_on": "<turn_on>"
},
"name": "set_light"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| turn_on | Yes |