Skip to main content
Glama

state_diff

Read-onlyIdempotent

Compare baseline and current network states to report changes heaviest first: missing routers, down interfaces, lost OSPF adjacencies, BGP drops, moved paths, and added routes.

Instructions

What changed from a baseline state you kept to the state now, heaviest first: routers gone or not read, interfaces down, OSPF adjacencies lost, OSPF interface values both ends must share that changed, BGP sessions down, best paths that moved (with the router's reason), routes removed or moved (with originated_by: the router where that prefix is directly connected), then what came back or was added. none is true when nothing changed. Uptimes, counters and the management network are not compared. The baseline is whatever path you pass as before (a state you saved, or collect's previous). Read-only.

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": {
      "before": "<before>",
      "after": "<after>"
    },
    "name": "state_diff"
  }
}

Input Schema

NameRequiredDescriptionDefault
afterYesThe state now (same input as lab_state)
beforeYesThe baseline state (same input as lab_state)
routerNoOnly this router (default: all)
mgmt_subnetNoThe lab's management network, left out (default 172.20.20.0/24; netlab: 192.168.121.0/24)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.4.3

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already cover safety (readOnly=true, idempotent, non-destructive, closed-world), and the description adds real behavioral context beyond them: output ordering ('heaviest first'), the explicit non-compared categories, the semantics of the `none` flag, and the meaning of the `originated_by` field. It does not discuss output size, truncation, or handling of very large multi-router labs, which keeps it just under 5.

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 key point (what changed, heaviest first) is front-loaded, and the closing sentences on exclusions, the `none` flag, and baseline selection are efficient. The opening sentence is a very long enumeration, dense but each item conveys which change categories appear in the output, so it mostly earns its length.

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?

There is no output schema, so the description must describe the return value, and it does: ordered change categories, the `none` boolean, and the `originated_by` attribution. What an agent needs to call it correctly is present; only output shape details (nested structure, field names beyond `none` and `originated_by`) are left implicit.

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 coverage is 100%, with each parameter documented (including defaults for router and mgmt_subnet), so the schema already carries the parameter burden. The description adds modest value by clarifying that `before` is a saved baseline path and that the management network is excluded, but adds nothing about the `after` or `router` parameters beyond the schema. Baseline 3 is appropriate.

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 description states a specific operation (diffing two saved network states) and enumerates exactly what is compared: routers gone, interfaces down, OSPF adjacencies lost, BGP sessions down, moved best paths, removed routes, and additions. This distinguishes it cleanly from siblings like lab_state (capturing a state) and why_best_path (explaining a single path decision).

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?

It tells the agent where the baseline comes from ('a state you saved, or collect's previous') and what is deliberately excluded from comparison (uptimes, counters, management network), which functions as clear usage scoping. It stops short of explicitly naming an alternative tool to call when the agent only wants the current state, so it lands at 4 rather than 5.

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