Skip to main content
Glama

Plc Read

plc_read

Read data from PLCs via Modbus, FINS, MELSEC, or S7, interpreting values as uint16, int16, or float32. Specify address, count, and datatype to get typed values or raw interpretations.

Instructions

从 PLC 读取数据区并按数据类型解释。

address/count 为通用地址与数量, 语义由协议决定:

  • Modbus: address 为 0 基寄存器地址, count 为寄存器个数

  • FINS: address 为字地址, count 为字数

  • MELSEC: address 为起始编号, count 为点数 (位软元件按 16 点/字)

  • S7: address 为字节地址, count 为字节数 (count=4 + uint16 → 2 个值)

datatype 取 uint16/int16/float32, None 返回原始 16 位值 + 所有常见数据类型的多解释 (interpretations 字段), 便于 Agent 识别正确的数据类型。 byteorder 仅影响 float32 寄存器对顺序 (big=ABCD, little=DCBA)。

options: 协议特有参数, 由各协议 adapter 自行定义与校验。 用 list_protocols 查看每个协议的 read_options 说明。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
hostYes
portYes
unitNo
countNo
addressYes
optionsNo
datatypeNo
protocolYes
byteorderNobig
timeout_msNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
targetYes目标设备标识, 同时是连接池 key 的组成部分 (D1)。
addressYes
elapsed_msYes
interpretedNo
raw_registersYes
request_frameYes
interpretationsNo

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observedv0.4.0

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations provided, the description carries the full burden and does a good job: it discloses protocol-dependent address/count semantics, the special datatype=None behavior returning an interpretations field, and the byteorder effect on float32 register pairs. It does not mention timeout/error behavior or explicitly state read-only safety, but the read verb plus return behavior covers most of the risk profile.

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 organized into scannable bullets with the main purpose front-loaded. Each bullet adds necessary information (protocol semantics, datatype behavior, byteorder, options) and the final pointer to list_protocols prevents duplication.

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?

For a multi-protocol tool with 10 parameters and no annotations, the description covers the hard parts: protocol-specific addressing, datatype interpretation, byteorder, and where to find adapter-defined options. The existing output schema covers return shape, so its absence in prose is fine. Remaining gaps are the unexplained unit parameter and no statement about timeout/failure behavior, making it strong but not fully complete.

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?

Schema description coverage is 0%, so the description must compensate. It adds substantial meaning for address, count, datatype, byteorder, and options, including concrete examples like S7 count=4 + uint16 yielding 2 values. However, unit is left unexplained despite being protocol-sensitive (e.g., Modbus slave ID), which is a noticeable gap for a 10-parameter tool with zero schema descriptions.

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 opening line states a specific action and object: '从 PLC 读取数据区并按数据类型解释' (read data area from PLC and interpret by data type). This clearly separates it from siblings like parse_pcap, list_protocols, and proxy operations, even without naming alternatives.

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?

The description provides clear context for when to call the tool (to read live PLC data) and instructs the agent to consult list_protocols for read_options, which is useful workflow guidance. It does not explicitly state when not to use plc_read versus probing or parsing tools, so it stops short of a 5.

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

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/ymxc152/plctap'

If you have feedback or need assistance with the MCP directory API, please join our Discord server