Skip to main content
Glama

stream_capture

Capture serial data with arrival timestamps to diagnose intermittent data loss or periodic stalls, producing files ready for timing analysis.

Instructions

长时录测:持续采集串口一段时间,逐行打上到达时间戳落盘。

产出的文件**直接可以喂给 timing_analysis(path=...) ** —— 两件工具是同一条链路。

seconds 最长采集秒数;max_lines 收够多少行提前结束(0=不限); idle_stop_s 连续多少秒没数据提前结束(0=不用);out_path 默认落在会话日志目录 (已存在同名文件会自动改名,不覆盖旧现场)。

★ 为什么时间戳必须在采集端打:事后才拿到的日志如果没时间戳,时序信息就永久丢了。 采集时按到达时刻记一行,成本几乎为零,却让后面所有分析成立。 排查「偶发丢数据」「隔一会儿卡一下」时用:让它自己采几分钟,再看 timing_analysis。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
portYes
secondsNo
baudrateNo
out_pathNo
max_linesNo
idle_stop_sNo

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 full burden and does well: it discloses that each line gets an arrival timestamp, that output defaults to the session log directory, and crucially that an existing same-name file is auto-renamed rather than overwritten (non-destructive). It does not describe output structure or error behavior, but the key mutation/storage semantics are covered.

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-loaded with purpose and the timing_analysis chain, followed by compact per-parameter semantics. The ★ rationale paragraph on why timestamps must be captured at collection time is somewhat editorial, but it is short and supports correct usage.

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 values need not be described. The description covers purpose, use case, key non-destructive behavior, and most parameters, leaving it nearly complete; only port/baudrate semantics and any error conditions are absent.

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 explains four of six parameters well (seconds, max_lines with 0=unlimited, idle_stop_s with 0=disabled, out_path destination and rename behavior). Only port and baudrate go unexplained, though baudrate's default is visible in the schema.

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+resource (持续采集串口/continuous serial capture) with a clear scope modifier (长时录测/long-duration) and explicitly names its downstream consumer timing_analysis(path=...). An agent can tell this capture-and-timestamp tool apart from other serial readers without opening schemas.

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 a concrete triggering scenario (排查「偶发丢数据」「隔一会儿卡一下」) and the accompanying workflow (let it run a few minutes, then run timing_analysis). It does not, however, name when to prefer this over siblings like serial_session_log or serial_pair_record, so the exclusion guidance is missing.

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