Skip to main content
Glama

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

TableJSON Schema
NameRequiredDescriptionDefault
nameYes
Behavior4/5

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

No annotations provided, but description discloses that only labeled functions are returned, empty dict is normal, and slots F0-F28 exist. Explains behavior beyond a simple listing.

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?

Description is informative and well-structured with paragraphs, but slightly verbose. Front-loads purpose. Detail is mostly justified.

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?

Covers input (fuzzy name), output (dict of labels, empty ok), and usage context (before set_function). No output schema but explains return format adequately.

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?

Only one parameter 'name'; description adds that it's fuzzy-resolved same as find_locomotive and no need to call find_locomotive first. Schema coverage is 0%, but description adds significant meaning.

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 the tool lists a locomotive's named decoder functions, with an example. It distinguishes itself from siblings by noting it should be called before set_function when the user refers to a function by label.

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?

Explicit guidance: call this before set_function when user refers to function by action, and if empty dict, ask for F-number as alternative. Tells when to use and what to do with results.

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