Skip to main content
Glama

serial_open

Open a serial port such as COM3 or /dev/ttyUSB0 and return a handle for reading or writing embedded hardware; configure baud rate, data bits, parity, and stop bits.

Instructions

打开串口,返回句柄 handle。port 形如 "COM3" 或 "/dev/ttyUSB0"。 波特率不确定就先用 115200(STM32 HAL 默认)或 9600(老例程/模块默认)。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
portYes
parityNoN
baudrateNo
data_bitsNo
stop_bitsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.4/5.0
Behavior3/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 the return artifact (a handle), which is real behavioral value. But it omits resource-lifecycle traits an agent needs: that the handle must later be closed, whether a port is exclusively held, and what happens on a busy/nonexistent port.

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 tight sentences, front-loaded with purpose then parameter tips, with no filler. Efficient and appropriately sized for a small open-port tool.

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

Completeness3/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 explanation is not required. Given that, the description covers the essentials (port format, baudrate) but is thin on the resource-management context that matters for a stateful open operation, leaving it only minimally complete.

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

Parameters3/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 does partially: it specifies the port string format ('COM3' vs '/dev/ttyUSB0') and offers baudrate defaults. The remaining three parameters (parity, data_bits, stop_bits) are undocumented in both schema and description, so it does not fully close the gap.

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 ('打开串口' / open serial port) and names the returned artifact (handle), which cleanly distinguishes it from siblings like serial_read/serial_send/serial_close. It does not explicitly name an alternative, but the open-semantics are unambiguous.

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?

Provides actionable guidance on choosing a baudrate ('115200 for STM32 HAL, 9600 for old routines/modules'), which is genuinely useful. However it gives no when-to-use/when-not framing, no mention of pairing with serial_close, and no pointer to serial_list or baudrate_autodetect as alternatives.

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