Skip to main content
Glama

CIDR Subtraction

cidr-subtract
Read-onlyIdempotent

Use to prepare WireGuard AllowedIPs exceptions or calculate remaining address space relative to supplied include and exclude lists. Compute union(include) minus union(exclude) as a minimal sorted canonical CIDR list, without adding addresses. Use one address family, a nonempty include list, and at most 1000 entries across both lists, up to 64 characters each. Exclude may be empty. Normalize host bits and count overlaps once. Return cidrs, normalizedInclude, normalizedExclude, and exact decimal-string includedAddressCount, removedAddressCount, remainingAddressCount. Complete removal returns an empty list; more than 10000 output CIDRs returns an error without a partial result. Error issues identify include or exclude and the zero-based entry index. Remote calls submit inputs to this server; the browser calculates locally. This does not inspect live allocation, configure WireGuard, or change firewall rules. Operational events record the tool name, success or error, a controlled error code, and a traffic source classification. Verified automated checks may also record an automation run identifier. Events exclude inputs, results, raw request headers, and automation tokens. Cloudflare may attach platform metadata. Privacy policy: https://packetrove.com/privacy.

Input Schema

NameRequiredDescriptionDefault
excludeYesRanges to remove from the included address space. An empty array simplifies the exact include union.
includeYesThe nonempty included address space. Use at most 1,000 entries across include and exclude, from one address family.

Output Schema

NameRequiredDescriptionDefault
cidrsYes
familyYes
normalizedExcludeYes
normalizedIncludeYes
removedAddressCountYesExact number of addresses as a base-10 string, including network and broadcast addresses.
includedAddressCountYesExact number of addresses as a base-10 string, including network and broadcast addresses.
remainingAddressCountYesExact number of addresses as a base-10 string, including network and broadcast addresses.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.5/5.0
Behavior5/5

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

Annotations already cover safety (readOnly, idempotent, non-destructive, closed-world), and the description adds substantial non-schema behavior: normalization of host bits, overlap counted once, the >10000 output CIDRs hard error with no partial result, error payloads identifying list and zero-based index, remote-vs-browser execution, and telemetry/privacy disclosure with exclusions about what is not logged.

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?

Purpose and constraints are front-loaded, which is good, but the definition runs long and the tail paragraphs on operational events and privacy policy are verbose relative to their value for tool selection. Information density is high but structure is closer to a compliance statement than a tight tool description.

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?

An output schema exists, yet the description still enumerates the returned fields and the empty-list success case and the error case, alongside all input constraints. For a pure computation tool with two array params, nothing an agent needs to invoke it correctly is missing.

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 100%, so the baseline is 3; the description then adds cross-parameter constraints the schema cannot express — one address family across both lists, a combined 1000-entry budget, 64-character limit, exclude allowed to be empty, include required nonempty, and the semantic consequence that an empty exclude simplifies the exact union.

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 precise operation as a formula — 'Compute union(include) minus union(exclude) as a minimal sorted canonical CIDR list, without adding addresses' — plus a concrete use case (WireGuard AllowedIPs exceptions). The phrase 'without adding addresses' implicitly separates it from aggregating siblings like cidr-cover, and the explicit non-goals ('does not inspect live allocation... change firewall rules') further bound what the tool is.

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?

Gives clear triggering contexts (prepare WireGuard AllowedIPs exceptions, calculate remaining address space) and explicit when-not-to-use cases. It does not name any sibling tool (cidr-cover, range-to-cidrs, public-ip) or state which to pick instead, so it stops short of full routing guidance.

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.