检索串口日志
log_queryQuery serial port log entries by connection, direction, sequence or time range, substring, or regex, searching both in-memory and on-disk history and returning matching lines with counts.
Instructions
检索串口日志条目。日志按行切分(\n / \r\n),每条含全局 seq 索引、epoch 时间戳 ts、方向 dir(rx/tx)、内容 line/hex/bytes。支持按连接、方向、索引范围(seq_from/seq_to)、时间范围(time_from/time_to)、内容子串(contains)、正则(regex)过滤。存储:内存保留最近 N 条,最旧溢出到磁盘(每连接分片 JSONL,超保留上限自动淘汰最旧分片);检索时内存+磁盘都查。返回 entries(含 count/truncated)与 earliest_seq/retention(earliest_seq 之后的历史才完整,淘汰过的更早部分不可回溯)。
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "log_query"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dir | No | 方向过滤 | |
| limit | No | 返回条数上限,默认 100 | |
| order | No | 排序,默认 asc(旧→新) | |
| regex | No | 正则匹配(作用于 line) | |
| seq_to | No | 索引上界(含) | |
| time_to | No | 时间上界(epoch ms,含) | |
| contains | No | 内容子串匹配(区分大小写,作用于 line) | |
| seq_from | No | 索引下界(含) | |
| time_from | No | 时间下界(epoch ms,含) | |
| connection_id | No | 连接 ID;省略则全查 |