Skip to main content
Glama

modbus_parse

Parse Modbus RTU frames to extract register values and coil states, or decode exception codes 01-06 with troubleshooting advice when a slave returns an unreadable response.

Instructions

解析 Modbus RTU 帧:正常响应拆出寄存器值/线圈状态,异常响应(功能码|0x80) 直译异常码 01-06(非法功能/非法地址/非法值/设备故障/忙...)并给排查建议。 从站"该响应但不响应/回了一帧看不懂"时用它。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
hex_frameYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.5/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It does disclose the output semantics for both normal and exception frames, which is useful, but a pure parser has little side-effect profile to reveal and the description says nothing about input expectations (raw hex, CRC included or not) or error handling on malformed frames.

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?

Two dense sentences with the core purpose front-loaded and the usage trigger trailing behind it. No filler, though the parenthetical exception-code list is slightly long for the value it adds over the output schema.

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?

An output schema exists, so return-value detail is not owed, and the description covers purpose, the exception-handling branch, and the usage trigger. The remaining gap is input-format specification, which matters for a tool whose only job is to accept a frame.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0% for the single parameter hex_frame, so the description must compensate and it does not. It refers to a 'frame' generically and adds no syntax guidance such as whether the CRC bytes should be included, byte order, or whitespace tolerance, leaving the caller to guess what a valid value looks like.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb+resource ('解析 Modbus RTU 帧') and enumerates the two branches it handles: normal responses decoded into register/coil values, and exception responses (function code |0x80) mapped to codes 01-06 with troubleshooting advice. It is clearly more specific than a generic parser, but it never names the nearest siblings (modbus_crc, frame_parse) so the agent must infer the boundary itself.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives an explicit triggering context: use it when the slave 'should respond but doesn't, or returns a frame you can't read.' That is a clear when-to-use. It offers no exclusions or named alternatives (e.g. modbus_crc for CRC computation, frame_parse for non-Modbus frames), so routing is only partially resolved.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.