Skip to main content
Glama
badchars

osint-mcp-server

by badchars

whois_ip

Perform RDAP/WHOIS lookups on IP addresses to identify network ownership, CIDR ranges, geographic location, and responsible entities for reconnaissance and analysis.

Instructions

RDAP/WHOIS lookup for an IP address. Returns network name, CIDR range, country, and responsible entities.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ipYesIP address to look up

Implementation Reference

  • The implementation of the whoisIp tool which queries the rdap.org API for IP information.
    export async function whoisIp(ip: string): Promise<RdapIpResult> {
      await limiter.acquire();
      const res = await fetch(`https://rdap.org/ip/${ip}`);
      if (!res.ok) throw new Error(`RDAP IP lookup failed: ${res.status} ${res.statusText}`);
      const data = await res.json();
    
      const entities: RdapIpResult["entities"] = [];
      if (data.entities) {
        for (const ent of data.entities) {
          const roles = ent.roles ?? [];
          const vcard = ent.vcardArray?.[1];
          let name: string | undefined;
          if (vcard) {
            const fn = vcard.find((f: any) => f[0] === "fn");
            if (fn) name = fn[3];
          }
          for (const role of roles) {
            entities.push({ role, name });
          }
        }
      }
    
      // Build CIDR from cidr0_cidrs
      let cidr: string | undefined;
      if (data.cidr0_cidrs?.[0]) {
        const c = data.cidr0_cidrs[0];
        cidr = `${c.v4prefix ?? c.v6prefix}/${c.length}`;
      }
    
      return {
        ip,
        name: data.name,
        type: data.type,
        startAddress: data.startAddress,
        endAddress: data.endAddress,
        cidr,
        country: data.country,
        entities,
        port43: data.port43,
      };
    }
  • The tool registration and tool definition for whois_ip in the protocol/tools layer.
    const whoisIpTool: ToolDef = {
      name: "whois_ip",
      description: "RDAP/WHOIS lookup for an IP address. Returns network name, CIDR range, country, and responsible entities.",
      schema: {
        ip: z.string().describe("IP address to look up"),
      },
      execute: async (args) => json(await whoisIp(args.ip as string)),
    };
  • The type definition for the RDAP IP lookup result.
    interface RdapIpResult {
      ip: string;
      name?: string;
      type?: string;
      startAddress?: string;
      endAddress?: string;
      cidr?: string;
      country?: string;
      entities: { role: string; name?: string }[];
      port43?: string;
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions the return data (network name, CIDR range, country, responsible entities) but lacks details on error handling, rate limits, authentication needs, or data freshness. This is a significant gap for a tool with no annotation coverage.

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 a single, efficient sentence that front-loads the core function and key return values without unnecessary details. Every part of the sentence adds value, making it highly concise and well-structured.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's low complexity (one parameter, no output schema, no annotations), the description is minimally adequate. It covers the purpose and output but lacks behavioral context like error cases or performance traits, which would be beneficial for an agent to use it effectively.

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%, with the parameter 'ip' clearly documented in the schema. The description adds no additional parameter semantics beyond what the schema provides, such as format examples (e.g., IPv4 vs. IPv6) or validation rules, so it meets the baseline for high schema coverage.

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 clearly states the tool's purpose with a specific verb ('RDAP/WHOIS lookup') and resource ('for an IP address'), distinguishing it from sibling tools like 'whois_domain' (for domains) and 'vt_ip' (VirusTotal IP analysis). It precisely communicates the lookup function.

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 description implies usage context by specifying 'IP address' lookup, which differentiates it from domain or other network tools in the sibling list. However, it does not explicitly state when to use this tool versus alternatives like 'bgp_ip' or 'geoip_lookup', leaving some ambiguity.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/badchars/osint-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server