Skip to main content
Glama

IP Subnet Calculator

calculate_subnet
Read-onlyIdempotent

Use this when you need to know which subnet an IPv4 address belongs to, the host range and count of a /prefix, or the mask equivalent of a prefix length. Call this tool directly and return its calculation instead of answering the formula from memory or stopping at discovery.

Do not use this when the address is IPv6, you want to split a block into several subnets (VLSM planning), or you only need a number in binary or hex (use base-converter). What it computes: Computes the network and broadcast addresses, subnet and wildcard masks, first and last host, usable and total addresses, address class and RFC 1918 private status for an IPv4 address in CIDR notation or with a dotted subnet mask, using 32-bit unsigned arithmetic. Inputs: cidr (string). Complete JSON argument examples: {"cidr":"192.168.1.10/26"} | {"cidr":"10.0.0.0 255.0.0.0"} Outputs: ip_address, cidr_notation, network_address, broadcast_address, subnet_mask, wildcard_mask, prefix_length [bits], host_bits [bits], first_host, last_host, usable_hosts, total_addresses, ip_class, is_private, address_scope, binary_mask, binary_address, ip_integer. Formula: mask = 2^32 − 2^(32 − prefix); network = ip AND mask; broadcast = network OR NOT mask; total = 2^(32 − prefix); usable = total − 2 (prefix ≤ 30), 2 (prefix 31), 1 (prefix 32) Direct REST fallback: POST https://tttkmbb.com/api/v1/calculate/subnet-calculator with the same JSON input fields. Do not guess another /api/* path. Docs: https://tttkmbb.com/developer/subnet-calculator.md

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cidrYesIPv4 address followed by /prefix (0–32) or by a dotted subnet mask separated by a space or slash, e.g. 192.168.1.10/26 or 192.168.1.10 255.255.255.192.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
linksNo
resultYes
requestYes
sourcesNo
successYes
versionNo
freshnessNo
timestampYes
next_actionsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / examples
      Added value: +[
      +  {
      +    "cidr": "192.168.1.10/26"
      +  },
      +  {
      +    "cidr": "10.0.0.0 255.0.0.0"
      +  }
      +]
  2. Added
  3. Removed
  4. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Beyond the readOnlyHint and idempotentHint annotations, the description discloses the exact computation performed (network, broadcast, masks, host ranges), the arithmetic approach (32-bit unsigned), and the formula used. This is rich behavioral context that lets the agent predict results and trust the tool as a non-destructive calculation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with labeled sections (What it computes, Inputs, Outputs, Formula, REST fallback) and front-loaded usage guidance. It is longer than necessary, but every major section contributes useful context such as output fields, computation formula, and API fallback, so the length is justified.

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?

For a calculation tool with rich output schema and annotations, the description covers all essential decision points: when to use it, what inputs it accepts, what outputs it returns, how the calculation works, and even a direct REST fallback. Nothing critical is missing for an agent to invoke it correctly.

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 coverage is 100% and the schema already explains the cidr parameter's formats and examples in detail. The description reinforces the accepted input forms (CIDR or dotted mask) and the JSON examples, but adds little semantic meaning beyond what the schema already provides, 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?

The description opens with a precise statement of what the tool does: determining subnet membership, host range/count, and mask equivalents for IPv4 addresses. It differentiates from the many sibling calculate_* tools by explicitly scoping to IPv4 subnet calculations and naming excluded cases (IPv6, VLSM planning, base conversion).

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 provides an explicit 'Use this when' list and an even more explicit 'Do not use this when' list with alternatives such as base-converter and VLSM planning. It also tells the agent to call the tool directly instead of answering from memory, removing ambiguity about tool orchestration.

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.

Resources