Skip to main content
Glama

get_sensor

Retrieve the current active/inactive state of a sensor to determine block occupancy or other real-world conditions.

Instructions

Get the current ACTIVE/INACTIVE state of one sensor.

Args: name: Sensor name (JMRI system name like "RS22", or its user-friendly label like "Montagne B") or an unambiguous fragment of the label. Case-insensitive.

Use this to answer "is block X occupied?" or similar real-world state questions ("is the clock running?" for the ISCLOCKRUNNING sensor JMRI always has). Read-only — there is no set_sensor tool, since a sensor reflects hardware JMRI detects, not a command this project should issue. No side effects.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes
Behavior4/5

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

With no annotations, the description carries the full burden. It discloses read-only behavior, no side effects, and that sensors reflect hardware. However, it does not mention error handling (e.g., if sensor not found) or return format details, which would enhance transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise and well-structured: it starts with the core purpose, provides usage examples, and ends with behavioral notes. Every sentence adds value; no redundant or excessive text.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no output schema, the description explains the main return (ACTIVE/INACTIVE state) but does not specify the exact format (e.g., string, object) or potential errors. For a simple tool, it covers essential context but could be more explicit about the return representation.

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?

The schema has 0% description coverage, so the description fully compensates. It explains the 'name' parameter with acceptable formats (system name, user label, or fragment), case-insensitivity, and examples, making the parameter's usage crystal clear.

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 gets the ACTIVE/INACTIVE state of a sensor, with examples like 'is block X occupied?'. It distinguishes from siblings by emphasizing there is no set_sensor tool, and it references the sensor's hardware-driven nature, making the purpose unambiguous.

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 states when to use this tool (to answer real-world state questions) and that it is read-only with no side effects. It also notes the absence of a set_sensor tool, guiding the agent not to look for one. This provides clear context and exclusions.

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