command_trace
Generates an interactive HTML report mapping each command to the device that received it, with topology view, success/failure status, and expandable output for troubleshooting.
Instructions
把“哪条命令打到了哪台设备”整理成可交互的 HTML 可视化报告。
报告分两块:左边是按 .topo 真实坐标画的拓扑,每台设备角标写着它收到多少条命令、 有几条失败,点设备会跳到右边对应的命令明细;右边按设备列出每条命令的时间、 来自哪个工具(下发 / 执行 / 探测 / 读回)、执行状态和可展开的回显。
所有设备操作都会自动留痕,不需要额外开关。日志在 %USERPROFILE%.ensp-mcp\commands.jsonl,可用 ENSP_MCP_LOG_DIR 改目录。
Args: path: .topo 路径。给了就只看这份拓扑上的记录,并按它的坐标画图; 省略则用最近一次 topo_* 用过的拓扑,再没有就把日志里的设备平铺成网格。 device: 只看某一台设备,例如 "Core1"。省略看全部。 out_path: 报告输出路径,省略则写到拓扑同目录的 <拓扑名>-commands.html。 limit: 最多取最近多少条命令记录,默认 2000,范围 1–20000。 show_output: 明细里是否附带命令回显,默认带。 open_browser: 生成后是否自动用默认浏览器打开,默认不打开。
返回 report(HTML 绝对路径)、commandCount、failedCommands、byDevice 等统计。
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": "command_trace"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | No | ||
| limit | No | ||
| device | No | ||
| out_path | No | ||
| show_output | No | ||
| open_browser | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |