get_locomotive_functions
Retrieve custom function labels for a locomotive to map descriptive commands (e.g., 'rear lights') to their correct function numbers, enabling natural language control without guessing F-numbers.
Instructions
List a locomotive's named decoder functions (e.g. "F2": "Rear lights").
JMRI lets the user label each loco's functions individually in its roster editor — call this BEFORE set_function whenever the user refers to a function by what it does ("turn on the rear lights", "blow the whistle") instead of an F-number, so you can look up the right number instead of guessing or asking. Only labels the user actually set are returned; most locos have few or none (an empty "functions" dict is normal, not an error — it means this loco has no custom labels, so ask the user for an F-number instead).
Args: name: The locomotive's name (fuzzy-resolved the same way as find_locomotive — call this directly, you don't need to call find_locomotive first just to get the exact name).
Returns functions as {"F0": "label", ...}. Function numbers with no label set are omitted entirely (JMRI has 29 possible slots, F0-F28, per loco — only the labeled ones are useful to you).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes |