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
| Name | Required | Description | Default |
|---|---|---|---|
| op | Yes | inspect: 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). | |
| ranges | Yes | CIDR (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. | |
| exclude | No | Only for op=subtract. | |
| addresses | No | Only for op=contains. | |
| normalizeMapped | No | Treat ::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. |