Skip to main content
Glama

ensp_gather_diagnostic_context

Collect full device state (config, interfaces, version) after a command fails, then generate a structured reasoning prompt so an LLM can diagnose the root cause.

Instructions

当命令执行失败时,自动收集设备全貌供 LLM 深度推理。

ensp_diagnose_error 的区别:

  • ensp_diagnose_error 返回规则引擎的快速匹配结果

  • 本工具收集设备真实状态(配置、接口、最近输出),生成结构化推理 prompt, 供 LLM 像网络工程师一样分析根因

本工具会自动执行以下探查命令(无需手动调用):

  1. display version — 设备信息

  2. display current-configuration — 运行配置

  3. display ip interface brief — 接口状态

返回的 reasoning_prompt 字段可直接用于 LLM 推理, 引导 LLM 按四步分析:错误类型判断 → 根因分析 → 修复方案 → 验证步骤。

典型使用场景:

  • ensp_smart_config 返回 has_error=true 且规则诊断置信度为 low 时

  • 规则引擎未覆盖的未知错误

  • 需要 LLM 结合配置上下文做深度推理的复杂场景

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
error_textYes
failed_commandYes
session_id_or_nameYes
experiment_descriptionNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.2

TDQS

A4.2/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 the three probe commands that will be auto-executed, that they require no manual invocation, and that the output includes a reasoning_prompt driving a four-step analysis. It stops short of stating permissions or explicitly that it is read-only/side-effect-free, so a small behavioral gap remains.

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-loads the core purpose, then uses labeled sections (difference from sibling, auto-executed commands, returned field, typical scenarios). Slightly long but every block earns its place for a multi-step diagnostic tool.

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?

Given an output schema exists, return values need not be detailed, yet the description still explains the reasoning_prompt and the four-step workflow. The main gap is parameter semantics rather than anything about the tool's behavior or scope, which is well covered.

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

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0% across four parameters (session_id_or_name, failed_command, error_text, experiment_description), and the description gives no per-parameter meaning, format, or examples. The only implicit signal is that a failed command and its error text drive the analysis; the session identifier and experiment_description are entirely unexplained.

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 action (gather full device context on command failure) and explicitly contrasts itself with the sibling ensp_diagnose_error, naming what each returns. An agent can distinguish this reasoning-oriented tool from the rule-engine tool without opening either schema.

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

Usage Guidelines5/5

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

Provides explicit when-to-use conditions (ensp_smart_config returns has_error=true with low-confidence rule diagnosis, unknown errors, complex reasoning scenarios) and names the alternative tool plus the exact condition that selects it.

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