Skip to main content
Glama

Calculate a CIDR block

calculate_cidr
Read-onlyIdempotent

Return the network, broadcast, host range, and host count for an IPv4 or IPv6 CIDR. Optionally test whether an address is inside it, split it, or merge it with other CIDRs.

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": {
      "cidr": "<cidr>"
    },
    "name": "calculate_cidr"
  }
}

Input Schema

NameRequiredDescriptionDefault
cidrYesIPv4 or IPv6 CIDR, such as 192.168.1.0/24 or 2001:db8::/32. A dotted mask may follow the address.
mergeNoExtra CIDRs to aggregate with cidr.
containsNoAddress to test for membership.
splitPrefixNoLonger prefix to split into, at most 256 networks.

Output Schema

NameRequiredDescriptionDefault
splitYes
mergedYes
summaryYes
containsYes
splitCountYes
containsDetailYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / additionalProperties
      Added value: +false
  2. First observed

TDQS

A4/5.0
Behavior3/5

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

Annotations already declare readOnlyHint, idempotentHint, and closed-world scope, so the safety profile is covered. The description adds the shape of the computed results but says nothing about limits (e.g., the 256-network cap on split) or error handling beyond what the schema supplies.

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, zero waste, with the core operation front-loaded before the optional extensions. Every clause earns its place.

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?

With an output schema, full parameter coverage, and safety annotations, the description covers everything an agent needs to call it correctly. Only minor operational details, such as invalid-input handling, are left unstated.

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%, so cidr, merge, contains, and splitPrefix are all documented in the schema. The description only restates the optional operations at a high level, adding no format or syntax detail beyond what the schema provides — baseline 3 applies.

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 and resource ('Return the network, broadcast, host range, and host count for an IPv4 or IPv6 CIDR') and names the exact outputs produced. No sibling in the catalog computes CIDR data, so the description alone is enough to select it.

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 maps the optional capabilities to concrete scenarios: membership test, splitting, and merging with other CIDRs. It gives clear context for the optional parameters but offers no exclusions or caveats (e.g., invalid-CIDR behavior).

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.