Skip to main content
Glama

IPv4 Subnet Calculator

subnet_calc
Read-onlyIdempotent

Compute IPv4 subnet details from CIDR notation locally: get network and broadcast addresses, usable host range, total hosts, subnet mask, and wildcard mask. Handles /31 and /32 per RFC 3021.

Instructions

Compute IPv4 subnet details from CIDR notation entirely locally — no network call: network and broadcast addresses, usable host range, total usable hosts, subnet mask, and wildcard mask. /31 and /32 are handled per RFC 3021 (point-to-point / single host). Use this for IPv4 address planning. It does not query DNS or contact any host, so it is purely computational. Requires no API key and is NOT rate-limited (computed in-process). Returns the calculated fields as text.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cidrYesIPv4 address with a CIDR prefix length 0-32 (e.g., '192.168.1.0/24'). IPv4 only; host bits may be any address inside the block.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
prefixYesCIDR prefix length
networkYesNetwork address
lastHostYesLast usable host
broadcastYesBroadcast address
firstHostYesFirst usable host
reportUrlYesHuman-facing interactive report on dechonet.com
subnetMaskYesDotted-decimal subnet mask
totalHostsYesUsable host count
wildcardMaskYesWildcard (inverse) mask

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.1.0
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "http://json-schema.org/draft-07/schema#",
      +  "additionalProperties": false,
      +  "properties": {
      +    "broadcast": {
      +      "description": "Broadcast address",
      +      "type": "string"
      +    },
      +    "firstHost": {
      +      "description": "First usable host",
      +      "type": "string"
      +    },
      +    "lastHost": {
      +      "description": "Last usable host",
      +      "type": "string"
      +    },
      +    "network": {
      +      "description": "Network address",
      +      "type": "string"
      +    },
      +    "prefix": {
      +      "description": "CIDR prefix length",
      +      "type": "number"
      +    },
      +    "reportUrl": {
      +      "description": "Human-facing interactive report on dechonet.com",
      +      "type": "string"
      +    },
      +    "subnetMask": {
      +      "description": "Dotted-decimal subnet mask",
      +      "type": "string"
      +    },
      +    "totalHosts": {
      +      "description": "Usable host count",
      +      "type": "number"
      +    },
      +    "wildcardMask": {
      +      "description": "Wildcard (inverse) mask",
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "network",
      +    "broadcast",
      +    "firstHost",
      +    "lastHost",
      +    "subnetMask",
      +    "wildcardMask",
      +    "totalHosts",
      +    "prefix",
      +    "reportUrl"
      +  ],
      +  "type": "object"
      +}
  2. Changed1 schema field changedv1.0.3
    • changedInput schema / properties / cidr / description
      Previous value: -"IP with CIDR prefix (e.g., 192.168.1.0/24)"New value: +"IPv4 address with a CIDR prefix length 0-32 (e.g., '192.168.1.0/24'). IPv4 only; host bits may be any address inside the block."
  3. First observedv0.1.0

TDQS

A5/5.0
Behavior5/5

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

Beyond the annotations (readOnlyHint, idempotentHint, destructiveHint), the description discloses important behavioral traits: no network call, no DNS query, no API key, no rate limiting, and special handling of /31 and /32 per RFC 3021. This goes well beyond the annotation metadata.

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?

The description is compact and well-structured, with no fluff. Every sentence adds value: purpose, output, use case, computational nature, and edge-case handling. It fits within a few lines and is easily scannable.

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?

Given the simple input schema and the presence of an output schema (as indicated), the description fully covers what an agent needs: it enumerates the returned fields (network, broadcast, usable range, total hosts, subnet mask, wildcard mask) and notes the RFC 3021 exception. No additional context is necessary.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description covers 100% of the single parameter, and the description adds critical semantics: 'IPv4 only' and 'host bits may be any address inside the block.' This clarifies the expected input format beyond the schema alone.

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?

The description uses a specific verb ('Compute') and identifies the resource ('IPv4 subnet details'), clearly distinguishing it from sibling network diagnostic tools like port_scan or dns_lookup. It also states the output fields, making the purpose unambiguous.

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

Usage Guidelines5/5

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

It explicitly says 'Use this for IPv4 address planning' and highlights that it is purely computational with no network calls, no API key, and no rate limits. This gives clear when-to-use guidance and indirectly contrasts with the network-bound siblings.

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