RX 直落盘(大流量抓取)
dump_to_fileStream serial receive data directly to a file instead of through MCP, optionally clearing old buffer first, and return the path plus a tail preview. Stops on match, byte limit, idle timeout, or budget.
Instructions
把 Rx(可选先清缓冲)边收边写入文件,返回文件路径与结尾预览——大流量/长日志不经过 MCP 搬运。 结束条件优先级:match(字节) 出现 > 达到 max_bytes > 静默 idle_timeout_ms > budget_ms 耗尽。默认文件按天归档到 ~/.cache/serial-hub-mcp/dumps/。
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"connection_id": "<connection_id>"
},
"name": "dump_to_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dir | No | 输出目录(path 未给时用 dir) | |
| path | No | 输出文件路径(默认按天归档到 dumps 目录) | |
| flush | No | 先清旧缓冲再开始,默认 false | |
| match | No | 出现即停的匹配串(字节级) | |
| budget_ms | No | 采集预算(毫秒),默认 5000 | |
| max_bytes | No | 落盘字节上限 | |
| connection_id | Yes | 连接 ID(由 open 返回) | |
| match_encoding | No | match 的编码,默认 utf8 | |
| idle_timeout_ms | No | 静默即停阈值(毫秒),默认 300 |