Skip to main content
Glama

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

NameRequiredDescriptionDefault
pathNo
limitNo
deviceNo
out_pathNo
show_outputNo
open_browserNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.3.0

TDQS

A4.1/5.0
Behavior3/5

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

With no annotations at all, the description carries the full disclosure burden, and it does well on several points: it says logs are recorded automatically with no toggle, names the log file at %USERPROFILE%\.ensp-mcp\commands.jsonl, notes the ENSP_MCP_LOG_DIR override, and states the limit range of 1–20000. However, it does not say whether the tool only reads logs or whether generating a report has side effects, nor does it warn about overwriting an existing out_path file, which matters for a tool that writes HTML.

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?

It is front-loaded: purpose first, then panel layout, then logging behavior, then per-argument detail, so an agent can stop reading early. The panel description is slightly verbose, and the Args section restates schema defaults, though that is justified by the empty schema descriptions; overall it does not pad needlessly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a six-parameter report generator with an output schema, this is complete: it covers input semantics, logging preconditions, fallback behavior, and even summarizes key return fields (report path, commandCount, failedCommands, byDevice). Nothing an agent needs in order to invoke it correctly is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/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 carry all parameter meaning, and it does. Each of the six parameters is documented with semantics beyond its name: the path fallback chain (this topology, then last topology used by topo_*, then a flat grid), device filtering with an example value, the default output filename pattern, the limit default and range, and the defaults for show_output and open_browser.

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?

The definition opens with a specific verb plus a concrete artifact: it turns 'which command hit which device' records into an interactive HTML report. It then describes the two panels (topology with per-device command/failure badges, and per-device command detail with time, originating tool, status, and expandable output), which makes it unmistakably distinct from topology-only siblings like topo_render.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It implies the use case (visualizing command history after device operations) and explains fallback behavior when path is omitted, but it never states when to prefer this over siblings such as topo_render or device_sessions, and it gives no explicit when-not conditions.

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