Skip to main content
Glama
badchars

osint-mcp-server

by badchars

bgp_prefix

Look up BGP routing details for IP prefixes to identify announcing ASNs, network names, countries, and regional internet registries.

Instructions

Look up details for a specific IP prefix/CIDR. Returns announcing ASNs, name, country, and RIR.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
prefixYesIP prefix (e.g. '1.1.1.0')
cidrYesCIDR mask (e.g. 24)

Implementation Reference

  • The actual implementation of the bgp_prefix logic, fetching data from bgpview.io.
    export async function bgpPrefix(prefix: string, cidr: number): Promise<BgpPrefixResult> {
      const key = `prefix:${prefix}/${cidr}`;
      const cached = cache.get(key);
      if (cached) return cached;
    
      const data = await bgpFetch(`/prefix/${prefix}/${cidr}`);
    
      const result: BgpPrefixResult = {
        prefix: data.prefix,
        cidr: data.cidr,
        asns: (data.asns ?? []).map((a: any) => ({
          asn: a.asn, name: a.name, description: a.description, countryCode: a.country_code,
        })),
        name: data.name ?? "",
        description: data.description_short ?? "",
        countryCode: data.country_code ?? "",
        rir: data.rir_allocation?.rir_name ?? "",
      };
    
      cache.set(key, result);
      return result;
    }
  • The return type schema for the bgp_prefix tool.
    interface BgpPrefixResult {
      prefix: string;
      cidr: number;
      asns: { asn: number; name: string; description: string; countryCode: string }[];
      name: string;
      description: string;
      countryCode: string;
      rir: string;
    }
  • Tool registration and definition for bgp_prefix in the MCP tool registry.
    const bgpPrefixTool: ToolDef = {
      name: "bgp_prefix",
      description: "Look up details for a specific IP prefix/CIDR. Returns announcing ASNs, name, country, and RIR.",
      schema: {
        prefix: z.string().describe("IP prefix (e.g. '1.1.1.0')"),
        cidr: z.number().describe("CIDR mask (e.g. 24)"),
      },
      execute: async (args) => json(await bgpPrefix(args.prefix as string, args.cidr as number)),
    };
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. It discloses the return data (announcing ASNs, name, country, and RIR), which adds value beyond the input schema. However, it lacks details on behavioral traits such as rate limits, authentication needs, error handling, or data freshness. For a lookup tool with no annotations, this leaves significant gaps in understanding its operation.

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 purpose and key return values. Every word earns its place with zero waste, making it easy for an AI agent to parse quickly. It's appropriately sized for a simple lookup tool.

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 (2 required parameters, no output schema, no annotations), the description is moderately complete. It covers the purpose and return values, but lacks context on usage, behavioral traits, and output structure. For a lookup tool, this is adequate but leaves gaps that could hinder an AI agent's effective use, especially without annotations or output schema.

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 the schema fully documents both parameters ('prefix' and 'cidr'). The description adds no additional parameter semantics beyond what's in the schema, such as format examples or constraints. Baseline score of 3 is appropriate as the schema does the heavy lifting, but the description doesn't compensate or enhance parameter understanding.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/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: 'Look up details for a specific IP prefix/CIDR' with the verb 'look up' and resource 'IP prefix/CIDR'. It distinguishes itself from siblings like 'bgp_asn' or 'bgp_ip' by focusing on prefix/CIDR lookups, but doesn't explicitly contrast with tools like 'vt_ip' or 'whois_ip' that might also handle IP data. The specificity is good but not fully differentiated across all siblings.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites, context, or exclusions, nor does it reference sibling tools like 'bgp_asn' for ASN lookups or 'whois_ip' for IP whois data. Usage is implied by the purpose but lacks explicit direction for an AI agent.

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