Skip to main content
Glama

serial_read

Reads serial port data non-blocking with early exit on regex match, idle timeout, or time limit. Returns text and HEX views plus match status.

Instructions

从串口读取数据(非阻塞,三条件提前退出)。 expect:正则,命中立即返回(如 expect="OK|ERROR" 等响应); idle_ms:静默超时(板子说完就走); seconds:总时长上限。返回文本视图 + HEX 视图 + 是否命中。 读到的内容同时累积进会话日志。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
expectNo
handleYes
idle_msNo
secondsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.9/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does well: it discloses non-blocking behavior, the three early-exit conditions, the return shape (text + HEX + match flag), and a side effect (content accumulates into the session log). It omits error/timeout failure behavior, which is the main remaining gap.

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?

Purpose and non-blocking qualifier are front-loaded, followed by tightly scoped one-line explanations of each parameter and the return format. No filler sentences; every clause adds information.

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 an output schema exists, the return description is a bonus rather than a necessity. The parameters, exit semantics, and side effect are all covered, leaving only prerequisite/error-handling details that an agent might want for a serial read.

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, and it does: expect is explained as a regex with immediate return, idle_ms as a silence timeout, and seconds as the total duration cap, each with a concrete example. Only 'handle' is left unexplained, but its role is obvious from context.

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 and resource ('从串口读取数据') plus a key behavioral qualifier (non-blocking, three early-exit conditions). An agent can distinguish it from serial_send/serial_open by the read semantics, though it never explicitly names those siblings.

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

Usage Guidelines3/5

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

Implied usage is conveyed through the three exit conditions (expect/idle_ms/seconds), which tells the agent how the read terminates. However, there is no explicit when-to-use vs alternative guidance and no stated prerequisite that a serial_open handle is required first.

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