Skip to main content
Glama

netdiag-mcp

A working Model Context Protocol server that exposes read-only network diagnostics as tools an AI client can call directly. This isn't a demo of the concept, it's a real server built against the official MCP Python SDK, with tests that actually run and a CI workflow that actually checks them.

All topology data is fabricated. No real hostnames, IPs, or credentials appear anywhere in this repo.

Why this exists

I run infrastructure for a real multi-site network, and the tools I use day to day (monitoring, ticketing, identity, and increasingly, MCP-connected AI clients) are only as useful as the boundary around what they're allowed to touch. This repo is that boundary made explicit and testable: five tools, all read-only, each one narrow enough to reason about on its own.

It's also a companion to two other repos:

  • agentic-infra-ops-toolkit — the architecture and decision record behind building this pattern in the first place.

  • network-iac-lab — the same four-layer redundancy model (circuit, power, core, access) that root_cause reasons over here, expressed as infrastructure-as-code instead of a diagnostics API.

Related MCP server: Cisco vManage MCP Server

Tools

Tool

What it does

list_sites

Lists every site known to the server

site_health

Layered health status for one site (circuit, power, core, access)

degraded_sites

Every site with at least one unhealthy layer

root_cause

Walks layers in dependency order and reports the most likely root-cause layer, not just every symptom independently

redundancy_gaps

Every (site, layer) pair currently lacking redundancy, even if that layer is healthy right now

root_cause is the one worth reading the code for: it doesn't just report what's broken, it reasons about which broken layer probably explains the others, based on the same circuit-power-core-access dependency order laid out in network-iac-lab's redundancy model.

Running it

pip install -e ".[dev]"
pytest tests/ -v

To run the server itself against an MCP client (stdio transport):

python3 -m netdiag_mcp.server

Point an MCP-compatible client (Claude Desktop, or any client using the official SDK) at this module and the five tools above become callable directly.

Design choices

  • Diagnostics logic is separate from protocol wiring. Everything in diagnostics.py is plain Python with no MCP import, tested with plain pytest. server.py is a thin layer that exposes those functions as tools. If the MCP SDK's API changes, the actual logic doesn't need to.

  • Every tool is read-only. None of them can change state on a real system, only report on the sample data in sample_data/topology.json. A write-capable version of this would be a deliberate, separate addition, not something that falls out of a more "helpful" read tool by accident.

  • Errors are data, not exceptions that reach the client uncaught. An unknown site returns a structured error dict instead of letting an unhandled exception surface, so a calling AI client gets something it can reason about instead of a stack trace.

Tests

8 tests covering the diagnostics logic: health status aggregation, root-cause tracing across multiple failure scenarios, redundancy gap detection, and the unknown-site error path. Run in CI on every push via .github/workflows/test.yml.

Available Tools

5 tools
degraded_sitesA

List every site with at least one layer not reporting fully healthy.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.8/5.0
Behavior2/5

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

No annotations are provided, so the description carries the burden of disclosing behavioral traits. It does not mention side effects, read-only nature, authentication requirements, or potential errors. The phrase 'not reporting fully healthy' is also somewhat ambiguous regarding what 'reporting' means.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, clear sentence with no unnecessary words. It front-loads the action and includes the key filtering condition without redundancy.

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?

The description is adequate for a simple list operation with no parameters and an output schema indicated. It could mention output fields or ordering, but the existence of an output schema reduces the need for the description to explain return values.

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

Parameters4/5

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

The tool has zero parameters, so the baseline is 4. No parameter descriptions are needed since there are no parameters to explain.

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?

Description states a specific verb ('List') and resource ('sites') with a clear filtering condition ('at least one layer not reporting fully healthy'). It distinguishes itself from sibling tools like list_sites, which presumably lists all sites, by focusing on degraded ones.

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?

The description implies usage when needing sites with unhealthy layers, but it does not explicitly state when to use this over alternatives like site_health or root_cause. Guidance is present only by inference from the wording.

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

list_sitesA

List every site known to this diagnostics server.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.1/5.0
Behavior4/5

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

No annotations are provided, so the description carries the full burden. The verb 'list' clearly indicates a read-only operation, and there is no mention of side effects. While not explicitly stating 'read-only', the semantics are unambiguous enough for a safe interaction.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, concise sentence with no redundant words. It delivers the essential information efficiently.

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?

Given the absence of parameters and the simple listing action, the description is sufficient for an agent to invoke the tool correctly. No additional context is needed.

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?

The tool has no parameters, so schema coverage is 100%. The description adds no parameter-specific information because there is nothing to describe. This meets the baseline for high coverage.

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 clearly states the action (list) and the resource (sites) with specificity (every, known to this diagnostics server). It distinguishes itself from sibling tools like site_health or degraded_sites by being the comprehensive listing.

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?

The description implies when to use it (as the general listing of all sites) but does not explicitly name alternatives or conditions for choosing this tool over the siblings. An agent can infer usage from the wording, but it is not explicit.

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

redundancy_gapsA

List every (site, layer) pair currently lacking redundancy.

Flags layers that aren't redundant even if their current status is healthy, since a non-redundant healthy layer is one failure away from an outage.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.5/5.0
Behavior4/5

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

With no annotations, the description carries the burden of explaining behavior. It makes clear that the tool lists/flags redundancy gaps without indicating side effects or mutations, and it explains the rationale behind including healthy layers.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two concise sentences, with the primary purpose front-loaded and the second sentence adding a valuable clarifying nuance. No unnecessary words or details.

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?

Given the low complexity, no parameters, and existing output schema, the description is complete enough for an agent to understand what the tool does and why it matters.

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

Parameters4/5

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

The tool has no parameters, so the baseline is 4. There is no parameter information needed beyond the empty schema, and the description focuses entirely on the tool's purpose.

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 clearly states the action ('List') and the specific resource ('every (site, layer) pair currently lacking redundancy'), which distinguishes it from sibling tools like list_sites and site_health.

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 provides clear context for when to use the tool, especially the nuance that it flags non-redundant layers even when status is healthy. It does not explicitly mention alternatives or when not to use it, but the use case is clear.

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

root_causeA

Trace the most likely root-cause layer for a site's issues.

Walks circuit, power, core, and access in dependency order and reports the first layer that isn't healthy, since an upstream issue typically explains downstream symptoms rather than being a separate problem. site must exactly match a name returned by list_sites.

ParametersJSON Schema
NameRequiredDescriptionDefault
siteYes

TDQS

A4.1/5.0
Behavior4/5

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

No annotations are provided, so the description carries the full burden. It discloses the walk order, the logic (first unhealthy layer), and the reporting behavior. It does not mention side effects (likely read-only) or error cases, but for a trace tool this is a reasonable level of transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three sentences, each serving a purpose: purpose, algorithm/reasoning, and input constraint. Front-loaded with the primary action, no unnecessary fluff.

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

Completeness3/5

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

Covers purpose, algorithm, and input constraint, but does not specify the exact return format (e.g., whether it returns the layer name, a report object) or the behavior when all layers are healthy. Given there is no output schema, this is a minor gap for an agent invoking the tool.

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

Parameters4/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 compensate. It does so by adding a crucial constraint: 'site must exactly match a name returned by list_sites.' This gives meaning to the single parameter beyond the bare schema, making the input unambiguous.

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: 'Trace the most likely root-cause layer for a site's issues.' Describes the algorithm (walks circuit, power, core, access in dependency order) and the output (first unhealthy layer). This clearly differentiates it from siblings like site_health or degraded_sites, which focus on status or listing rather than root-cause analysis.

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?

Provides context for when it is appropriate ('an upstream issue typically explains downstream symptoms') and a prerequisite ('site must exactly match a name returned by list_sites'). However, it does not explicitly mention alternative tools or when NOT to use this one, leaving some ambiguity for the agent.

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

site_healthA

Get the layered health status (circuit, power, core, access) for a site.

site must exactly match a name returned by list_sites.

ParametersJSON Schema
NameRequiredDescriptionDefault
siteYes

TDQS

A3.9/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full behavioral burden. It discloses that the operation is a read ('Get'), enumerates the status layers, and adds the exact-match input constraint. However, it doesn't describe error behavior for mismatched site names, the output/return format, or any side effects — though for a low-risk read operation the risk profile is modest. Adds useful context but has gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences with zero waste. The primary purpose is front-loaded in the first sentence, and the operational constraint follows in the second. Every word earns its place with no redundancy or filler.

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 single-parameter read tool with no output schema and no annotations, the description covers the essentials: what the tool does and what the parameter requires. It could add the return format of the health status values, but the core calling information is complete and an agent can invoke this tool correctly with what's provided.

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

Parameters4/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 compensate, and it does: the second sentence clarifies that the 'site' parameter is a name that must exactly match one from list_sites. This adds meaningful semantic information beyond the bare schema, which only types it as a required string. The description fully compensates for the coverage gap for the sole parameter.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb ('Get') and resource ('layered health status') and enumerates exactly which layers are covered (circuit, power, core, access). This distinguishes it from siblings like list_sites (which lists sites) and degraded_sites (which finds problem sites), though it doesn't name them explicitly. Clear purpose with minor room for explicit sibling differentiation.

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 second sentence gives a concrete, actionable constraint: 'site must exactly match a name returned by list_sites.' This tells the agent to call list_sites first and use an exact name value. It implies usage context well but stops short of stating when not to use this tool or naming alternatives as the preferred choice for other scenarios.

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

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 5 tool updatesv0.1.0
    • First observeddegraded_sites
    • First observedlist_sites
    • First observedredundancy_gaps
    • First observedroot_cause
    • First observedsite_health

TDQS

A4.3/5.0
Disambiguation5/5

Each tool has a clear, distinct purpose: listing sites, checking health, identifying degraded sites, tracing root causes, and finding redundancy gaps. No overlap or ambiguity.

Naming Consistency5/5

All tool names use lowercase snake_case consistently, following a predictable and readable pattern. The mix of verb-led and noun-led names is coherent within the domain.

Tool Count5/5

Five tools is well within the typical range and perfectly suited for a network diagnostics server, covering the essential operations without unnecessary bloat.

Completeness5/5

The tool set provides comprehensive coverage for network diagnostics: listing sites, checking health, surfacing degraded sites, identifying root causes, and flagging redundancy risks. No critical gaps are apparent.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/miservicespro/netdiag-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server