Skip to main content
Glama

Test network policy connectivity

k8s_test_network_policy_connectivity

Tests Kubernetes NetworkPolicy connectivity by creating test pods in a namespace, verifying whether traffic is allowed or blocked under the specified policy.

Instructions

Test NetworkPolicy connectivity by creating test pods.

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": {
      "namespace": "<namespace>",
      "policy_name": "<policy_name>"
    },
    "name": "k8s_test_network_policy_connectivity"
  }
}

Input Schema

NameRequiredDescriptionDefault
contextNoNamed context of the multi-context pool to run against (see cm_multi_context list_contexts); the default context if omitted.
namespaceYes
policy_nameYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv3.4.2

TDQS

C2.9/5.0
Behavior2/5

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

Annotations declare readOnlyHint=false, destructiveHint=false and openWorldHint=true; the description's "creating test pods" explains the mutation but only restates what readOnlyHint=false already tells the agent. Critical behavior is undisclosed: whether the test pods are cleaned up or leaked, what cluster permissions are required, how long the test runs, and whether running it in a production namespace is discouraged. For a tool that spins up workloads, this is a meaningful gap.

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?

A single sentence with zero redundant wording, and the salient fact (it creates pods) is front-loaded rather than buried. The brevity borders on under-specification rather than verbosity, so it loses a point only for being a fragment rather than a structured statement of purpose and effect.

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

Completeness2/5

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

With no output schema and a side-effecting tool, the description should explain what the return value contains (per-connection pass/fail? created pod names?) and the cleanup guarantee, neither of which is present. Given the complexity of a network-policy connectivity probe, one sentence is not enough for an agent to invoke it confidently.

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?

Only the optional `context` parameter carries a schema description (33% coverage); `namespace` and `policy_name` are undocumented in both schema and description. The description does not explain the required parameters, though their names are largely self-explanatory, which keeps this at a minimum-viable 3 rather than lower.

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 names a specific verb and resource ("Test NetworkPolicy connectivity") and adds the mechanism ("by creating test pods"), which distinguishes it from the DNS-oriented sibling k8s_test_dns_connectivity and from policy mutation tools like k8s_update_network_policy_rules. It stops short of saying what the test actually verifies or how the outcome is judged, so it is clear but thin.

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

Usage Guidelines2/5

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

There is no statement of when to use this rather than k8s_test_dns_connectivity or the policy CRUD siblings, no prerequisites (does the policy need to pre-exist? does the namespace need labeling?), and no exclusions or environment cautions. The agent must infer all usage context from the name alone.

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

Deploy Server

Other Tools