Skip to main content
Glama

IPv4 Subnet Calculator

subnet_calc
Read-onlyIdempotent

Calculate IPv4 subnet details locally from CIDR: network/broadcast addresses, usable host range and count, subnet and wildcard masks. Handles /31 and /32 per RFC 3021 for address planning.

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
receiptsNoSigned observation receipts behind this result, one per lookup: when, from where and under which rules version DechoNet observed it. Each url shows the record and checks its Ed25519 signature.
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.5.14
    • addedOutput schema / properties / receipts
      Added value: +{
      +  "description": "Signed observation receipts behind this result, one per lookup: when, from where and under which rules version DechoNet observed it. Each url shows the record and checks its Ed25519 signature.",
      +  "items": {
      +    "additionalProperties": false,
      +    "properties": {
      +      "id": {
      +        "type": "string"
      +      },
      +      "tool": {
      +        "type": "string"
      +      },
      +      "url": {
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "tool",
      +      "id",
      +      "url"
      +    ],
      +    "type": "object"
      +  },
      +  "type": "array"
      +}
  2. 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"
      +}
  3. 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."
  4. First observedv0.1.0

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already cover the safety profile (readOnly, idempotent, non-destructive, openWorld=false), so the bar is lower. The description adds genuine value with RFC 3021 handling for /31 and /32, the absence of API-key/rate-limit concerns, and the text return format. The 'no network call' point partially restates openWorldHint=false, but the edge-case semantics are additive.

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?

Front-loaded with the core purpose but spends three separate sentences restating the same idea — 'entirely locally', 'does not query DNS or contact any host', and 'no API key / NOT rate-limited (computed in-process)'. That redundancy dilutes an otherwise tight definition.

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?

With an output schema present and annotations covering the safety profile, the description need not explain return values; it still notes the text format. Parameter semantics are covered by the 100%-covered schema, so nothing needed for correct invocation is missing.

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 single 'cidr' parameter is fully documented in the schema (IPv4 with prefix 0-32, host bits permitted). The description repeats 'CIDR notation' without adding syntax or format detail beyond the schema, so the baseline of 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 ('Compute IPv4 subnet details from CIDR notation') and enumerates exactly which outputs are produced (network/broadcast addresses, host range, host count, masks). The 'entirely locally — no network call' framing cleanly separates it from the network-querying siblings like dns_lookup and ip_info.

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

Usage Guidelines3/5

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

Provides a usage context ('Use this for IPv4 address planning') and implicitly rules out lookup tools by stating it contacts no host. However, no alternative sibling is named and no explicit when-not condition is given, so routing is only implied rather than resolved.

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