Skip to main content
Glama

get_block

Retrieve the occupancy state (OCCUPIED or UNOCCUPIED) of a model railroad block by its name or label.

Instructions

Get the current OCCUPIED/UNOCCUPIED state of one layout block.

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

Use this to answer "is block X occupied?" when the user names a layout block/section specifically (as opposed to a raw sensor id — if they instead name a sensor directly, use get_sensor). Read-only — there is no set_block tool, since a block reflects hardware JMRI detects via its linked sensor, not a command this project should issue. No side effects.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes
Behavior5/5

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

Discloses that the tool is read-only, has no side effects, and that the state comes from hardware detection via a linked sensor, not from a user command. This is especially important with no annotations, as it fully informs the agent about safe usage.

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?

Concise and well-structured: a one-sentence synopsis followed by an Args section. Every sentence adds value, no redundancy. The formatting is clean and easy to parse.

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?

For a simple read tool with one parameter, the description covers purpose, exact parameter semantics, usage guidance, differentiation from siblings, and behavioral traits. No output schema is needed because the return value (occupied/unoccupied) is implied. 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?

Despite 0% schema coverage, the description thoroughly explains the 'name' parameter: it can be a JMRI system name, user-friendly label, or unambiguous fragment, and is case-insensitive. This adds critical meaning beyond the schema's minimal 'Name' field.

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?

Clearly states it gets the OCCUPIED/UNOCCUPIED state of a layout block, with specific verb and resource. It also distinguishes from get_sensor by specifying when to use each tool. Sibling tools like get_sensor and list_blocks further differentiate.

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 describes when to use this tool (to answer 'is block X occupied?' when user names a layout block/section specifically) and when not (if they name a sensor directly, use get_sensor). Also states read-only and that no set_block tool exists, preventing misuse.

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