Skip to main content
Glama

baudrate_autodetect

Detect a serial port's baud rate by sampling candidates, scoring output for readable logs, and recommending a likely setting; use log_text for offline scoring.

Instructions

自动探测波特率:逐档打开串口采样,按"最像正常日志"评分排序并给推荐。 log_text 提供现成日志样本时走离线评分(不占串口)。设备静默时会提示先复位再扫。

★USB CDC 口(ESP32-S3 原生 USB、RP2040 等)上波特率不参与数据路径,本工具会 直接短路说明,不给排序——在那种口上"各档评分"只是同一批字节被反复读。 确需强行扫(例如怀疑枚举成 CDC 但实际是 UART 桥)时显式传 candidates, 如 candidates=[115200, 9600]。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
portYes
log_textNo
sample_sNo
candidatesNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.3/5.0
Behavior4/5

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

With no annotations, the description carries the burden and does so well: it discloses the USB CDC no-op behavior and its rationale (baud rate is not in the data path), the silent-device case, and that offline scoring avoids occupying the port. It does not state whether the port must be free/exclusive (potential conflict with serial_open) or the time cost implied by sample_s across candidates.

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?

Front-loads the core behavior, then adds the offline and silent-device cases before the USB CDC caveat. Generally tight, though the ★ section is somewhat verbose and slightly repetitive about repeated byte reads.

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 hardware-detection tool with an output schema (return values need not be explained) and no annotations, the behavioral coverage is strong. Remaining gaps are sample_s semantics and port exclusivity/timing expectations.

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. It adds real meaning for log_text (triggers offline mode) and candidates (explicit list to force scanning, with a concrete example), but says nothing about sample_s and only implicitly covers port.

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?

States a specific verb and resource ('自动探测波特率' - auto-detect baud rate) plus the mechanism (open port at each candidate, sample, score by log-likeness, recommend). It is clearly distinguishable from siblings like serial_open/serial_read, which do not perform detection.

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 routes the agent: supply log_text to use offline scoring that does not occupy the port; tell the user to reset when the device is silent; and on USB CDC ports the tool short-circuits, with the escape hatch being an explicit candidates list. Both when-to-use and when-not-to-use are covered.

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