Skip to main content
Glama

lab_verify

Validates eNSP lab configurations by running device commands and applying rule-based checks to deliver PASS/FAIL verdicts.

Instructions

按规则验证实验是否真的做对了,给出 PASS / FAIL 判定。

检查项 = 某台设备上跑一条命令 + 对回显的判定规则。两种给法:

  • suite:内置套件名,见下。

  • checks:自定义检查项列表,每项: {"name": "VRRP 主备", "target": "FW1", "command": "display vrrp", "expect": {"minCount": {"pattern": "State\s*:\s*(Master|Backup)", "atLeast": 1}}}

    target 可以是设备名、设备类别(AR / LSW / FW / WLAN / CLIENT)或 all, 用类别时会自动展开到这类所有设备。

expect 可组合的规则:contains / notContains(字符串或列表)、regex、 notRegex、minCount{"pattern","atLeast"}、reachable(布尔,ping 是否通)、 maxLoss(丢包率上限)。留空表示“命令跑通就算过”。

内置套件:

  • reachable:逐台登录,只验证 console 可连(最简单的连通性体检)

  • fw_ha:防火墙双机热备(HRP 角色 + 心跳口 + VRRP 主备)

  • bfd:BFD 会话 Up

  • ospf:OSPF 邻居 Full

  • vrrp:VRRP 主备

  • vlan:交换机上存在业务 VLAN

devices 可限定范围。检查项并发执行,concurrency 默认 4、最大 16。 返回 verdict(PASS / FAIL)、passed / failed / skipped 计数和每条检查的 状态、未满足的条件、回显片段。save_report 可把结果另存为 JSON。

验收跑过的命令同样自动留痕,tool 记为 lab_verify。

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": {
      "topo_path": "<topo_path>"
    },
    "name": "lab_verify"
  }
}

Input Schema

NameRequiredDescriptionDefault
hostNo127.0.0.1
suiteNo
checksNo
devicesNo
passwordNo
usernameNo
topo_pathYes
concurrencyNo
save_reportNo
new_passwordNo
include_outputNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.3.0

TDQS

A4.1/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 substantial work: it discloses that checks run concurrently with a default of 4 and a max of 16, that `target` categories auto-expand to all matching devices, and that every executed command is recorded under tool `lab_verify`. It also describes the return payload (verdict, passed/failed/skipped counts, per-check status, unmet conditions, echo snippets) and that `save_report` writes JSON. It does not state the safety profile (whether only read-only show commands are run) or the authentication expectations implied by the username/password parameters.

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?

The purpose is front-loaded in the first sentence, and the rest is organized into scannable bullets, an inline JSON example, and a suite list, so the density is justified by genuine complexity. The full enumeration of expect rule types is somewhat long but each rule name adds information an agent cannot get from the 0%-coverage schema. Little is wasted.

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?

For a tool with eleven parameters, two input modes, and nested check objects, this is close to complete: both modes, the target-expansion semantics, concurrency limits, and report persistence are all explained. The remaining gaps are the credential/connection parameters and `include_output`, which an agent would have to guess at. The existing output schema means return values need not be re-explained, so the verbose return summary is a bonus rather than a requirement.

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

Parameters3/5

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

Schema description coverage is 0%, so the description is the only source of parameter meaning, and it does document the core ones well: `suite`, `checks` (including the nested name/target/command/expect shape and every composable rule type), `devices`, `concurrency`, and `save_report`. However, five of eleven parameters — `topo_path` (the sole required one), `host`, `username`, `password`, `new_password`, and `include_output` — are never mentioned, and `new_password` in particular is opaque. Good compensation for the logic parameters but an incomplete one.

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 opening line states a specific verb and resource: verify whether a lab experiment was actually done correctly, returning a PASS/FAIL verdict. That is distinct from siblings like device_exec or device_probe, which execute or probe rather than apply per-command acceptance rules. An agent can tell what this tool produces without opening the schema.

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

Usage Guidelines4/5

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

The description clearly frames the two mutually exclusive input modes (a built-in `suite` versus a custom `checks` list) and enumerates six built-in suites with a short note on what each covers, which effectively tells the agent which suite to pick for which scenario. It also states the default rule when `expect` is empty. It stops short of naming when to prefer this over sibling tools such as device_exec or command_trace, so context is clear but exclusions are absent.

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