Skip to main content
Glama
badchars

osint-mcp-server

by badchars

geoip_batch

Batch geolocate up to 100 IP addresses at once using ip-api.com's free API.

Instructions

Batch geolocate up to 100 IP addresses at once. Uses ip-api.com (free, no API key).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ipsYesIP addresses to geolocate (max 100)

Implementation Reference

  • The main handler function for geoip_batch. Sends up to 100 IPs to ip-api.com/batch via POST and returns GeoIpResult[].
    export async function geoipBatch(ips: string[]): Promise<GeoIpResult[]> {
      if (ips.length === 0) return [];
      const batch = ips.slice(0, 100);
    
      await limiter.acquire();
      const res = await fetch("http://ip-api.com/batch", {
        method: "POST",
        headers: { "Content-Type": "application/json" },
        body: JSON.stringify(
          batch.map((ip) => ({
            query: ip,
            fields: "status,message,query,country,countryCode,region,regionName,city,zip,lat,lon,timezone,isp,org,as,asname,mobile,proxy,hosting",
          })),
        ),
      });
      if (!res.ok) throw new Error(`ip-api.com batch returned ${res.status}`);
      return res.json();
    }
  • ToolDef registration including name, description, and Zod schema (ips: z.array(z.string())).
    const geoipBatchTool: ToolDef = {
      name: "geoip_batch",
      description: "Batch geolocate up to 100 IP addresses at once. Uses ip-api.com (free, no API key).",
      schema: {
        ips: z.array(z.string()).describe("IP addresses to geolocate (max 100)"),
      },
      execute: async (args) => json(await geoipBatch(args.ips as string[])),
    };
  • Tool registered in the allTools array alongside geoip_lookup.
    geoipBatchTool,
  • src/index.ts:30-30 (registration)
    Tool listed in the top-level index.ts tool catalog under 'GeoIP' group.
    { label: "GeoIP", env: null, tools: ["geoip_lookup", "geoip_batch"] },
  • GeoIpResult interface defining the return type for geoip_batch results.
    interface GeoIpResult {
      query: string;
      status: string;
      country?: string;
      countryCode?: string;
      region?: string;
      regionName?: string;
      city?: string;
      zip?: string;
      lat?: number;
      lon?: number;
      timezone?: string;
      isp?: string;
      org?: string;
      as?: string;
      asname?: string;
      mobile?: boolean;
      proxy?: boolean;
      hosting?: boolean;
    }
Behavior3/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 external service and lack of authentication needs, but does not mention rate limits, response format, or error handling. Behavior is implied but not fully detailed.

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 sentences with no wasted words. The action is front-loaded, and the key details (batch size, data source, cost) are efficiently conveyed.

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

Completeness4/5

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

For a single-parameter tool with no output schema, the description is fairly complete. It covers the function, source, and constraints. However, the absence of output format or error behavior leaves some gaps for an AI agent.

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 input schema already explains the 'ips' parameter. The tool description restates the limit (up to 100), adding minimal extra value. Baseline 3 is appropriate.

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 action: batch geolocate IP addresses. It specifies the batch size limit (up to 100) and distinguishes itself from sibling geoip_lookup by the word 'Batch'.

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 mentions the data source (ip-api.com) and that it's free with no API key, which guides usage. However, it does not explicitly state when to use the batch tool over the single IP version or any alternatives.

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