Skip to main content
Glama
badchars

osint-mcp-server

by badchars

bgp_asn

Retrieve BGP ASN details including organization information, contacts, and announced IP prefixes to analyze network ownership and routing data.

Instructions

Look up ASN details and announced IPv4/IPv6 prefixes via BGPView. Returns ASN name, description, contacts, and all announced prefixes.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
asnYesAutonomous System Number (e.g. 13335)

Implementation Reference

  • The implementation of the 'bgpAsn' function which fetches and processes BGP ASN data from BGPView.
    export async function bgpAsn(asn: number): Promise<BgpAsnResult> {
      const key = `asn:${asn}`;
      const cached = cache.get(key);
      if (cached) return cached;
    
      const [info, prefixes] = await Promise.all([
        bgpFetch(`/asn/${asn}`),
        bgpFetch(`/asn/${asn}/prefixes`),
      ]);
    
      const result: BgpAsnResult = {
        asn: info.asn,
        name: info.name ?? "",
        description: info.description_short ?? info.description_full ?? "",
        countryCode: info.country_code ?? "",
        emailContacts: info.email_contacts ?? [],
        abuseContacts: info.abuse_contacts ?? [],
        website: info.website,
        ipv4Prefixes: (prefixes.ipv4_prefixes ?? []).map((p: any) => ({
          prefix: p.prefix, name: p.name, description: p.description, countryCode: p.country_code,
        })),
        ipv6Prefixes: (prefixes.ipv6_prefixes ?? []).map((p: any) => ({
          prefix: p.prefix, name: p.name, description: p.description, countryCode: p.country_code,
        })),
      };
    
      cache.set(key, result);
      return result;
    }
  • The registration of the 'bgp_asn' tool, defining its schema, description, and mapping to the 'bgpAsn' handler.
    const bgpAsnTool: ToolDef = {
      name: "bgp_asn",
      description: "Look up ASN details and announced IPv4/IPv6 prefixes via BGPView. Returns ASN name, description, contacts, and all announced prefixes.",
      schema: {
        asn: z.number().describe("Autonomous System Number (e.g. 13335)"),
      },
      execute: async (args) => json(await bgpAsn(args.asn as number)),
    };
  • The TypeScript interface 'BgpAsnResult' defining the structure of the data returned by the tool.
    interface BgpAsnResult {
      asn: number;
      name: string;
      description: string;
      countryCode: string;
      emailContacts: string[];
      abuseContacts: string[];
      website?: string;
      ipv4Prefixes: { prefix: string; name: string; description: string; countryCode: string }[];
      ipv6Prefixes: { prefix: string; name: string; description: string; countryCode: string }[];
    }
Behavior2/5

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

No annotations are provided, so the description carries full burden. It discloses the return data structure but lacks critical behavioral details: whether this is a read-only operation, rate limits, authentication requirements, error conditions, or freshness of BGP data. The description is functional but misses operational context.

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?

Two efficient sentences with zero waste: first states the action and source, second specifies return values. Every word contributes directly to understanding the tool's function without redundancy or fluff.

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 no annotations and no output schema, the description provides basic functional completeness but lacks operational context. For a network lookup tool with many siblings, it should ideally mention data source limitations, typical use cases, or how results differ from similar tools. The description covers what the tool does but not how it behaves in practice.

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

Parameters4/5

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

With 100% schema description coverage, the schema already documents the single 'asn' parameter thoroughly. The description adds no additional parameter semantics beyond what's in the schema, but since there's only one parameter and the schema is complete, this doesn't create a significant gap. The baseline for high schema coverage is 3, but the simplicity of a single parameter justifies a 4.

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 specific action ('Look up ASN details and announced IPv4/IPv6 prefixes') and resource ('via BGPView'), with explicit return values (ASN name, description, contacts, prefixes). It distinguishes from siblings like bgp_ip and bgp_prefix by focusing on ASN-based lookups rather than IP or prefix queries.

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?

The description implies usage when ASN details are needed, but provides no explicit guidance on when to use this tool versus alternatives like hackertarget_aslookup or whois_ip. It mentions the data source (BGPView) but doesn't specify limitations or prerequisites for use.

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