Skip to main content
Glama

cidr-math

CIDR math: IPv4 and IPv6 overlap, adjacency, merge, subtract, membership — Computes exact CIDR relations for agents planning networks, firewall rules or allow-lists: for up to 200 IPv4/IPv6 blocks it reports which pairs are equal, nested, partially overlapping or merely adjacent, the minimal merged CIDR list, a subtraction (blocks minus exclusions), address membership with the most specific match, or each block's first/last address, count and host-bits-set errors. It doe

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": {
      "op": "<op>",
      "ranges": "<ranges>"
    },
    "name": "cidr-math"
  }
}

Input Schema

NameRequiredDescriptionDefault
opYesinspect: normalize each range and flag host bits set. relations: pairwise equal/contains/overlap/adjacent/disjoint (pass only when no two ranges intersect). merge: minimal CIDR cover of the union. subtract: ranges minus exclude. contains: which ranges contain each address (pass only when every address is covered).
rangesYesCIDR (10.0.0.0/8, 2001:db8::/32), a bare address (a /32 or /128), or an inclusive range 10.0.0.1-10.0.0.9.
excludeNoOnly for op=subtract.
addressesNoOnly for op=contains.
normalizeMappedNoTreat ::ffff:a.b.c.d (and prefixes of 96 bits or longer inside ::ffff:0:0/96) as the IPv4 block a.b.c.d. Default false.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.9/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 and does disclose a real constraint: real constraint: it caps input at 'up to 200 IPv4/IPv6 blocks' and reports 'host-bits-set errors' rather than silently normalizing. It remains silent on whether output is pure computation (no side effects) and lacks any error/return-shape contract, partly because the text is cut off mid-word ('It doe').

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

Conciseness3/5

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

The operation list is front-loaded and dense with substance, but it is delivered as one run-on sentence and the text terminates abruptly ('It doe'), leaving an obviously unfinished clause. The wasted-filler burden is low, yet the truncation costs structural integrity.

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?

There is no output schema, so the description must explain return values — it does list what is reported per operation (pairs, merged list, subtraction result, first/last address, count, host-bit errors), which is adequate coverage. But it never describes the response structure or how multiple ops' results are keyed, and the truncated tail suggests missing content.

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 100% and the op enum already spells out inspect/relations/merge/subtract/contains semantics in detail, so the schema does the heavy lifting. The description restates the same operation set and adds only the 200-block limit and 'most specific match' for membership — useful but marginal beyond structured data.

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 verb+resource ('CIDR math') and then enumerates the exact operations — overlap, adjacency, merge, subtract, membership — with concrete semantics (equal, nested, partially overlapping, adjacent). An agent can tell precisely what this tool computes 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?

Names the intended consumer scenarios ('agents planning networks, firewall rules or allow-lists'), which is genuine usage context. However, it gives no explicit when-not guidance or preconditions (e.g., that subtract requires the exclude array, or that relations/contains serve as pass/fail gates) — that information lives only in the schema enum.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources