geoip_batch
Geolocate multiple IP addresses simultaneously to identify geographic locations of network endpoints for reconnaissance and analysis.
Instructions
Batch geolocate up to 100 IP addresses at once. Uses ip-api.com (free, no API key).
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ips | Yes | IP addresses to geolocate (max 100) |
Implementation Reference
- src/geoip/index.ts:42-59 (handler)The core logic for the 'geoip_batch' tool, which sends a POST request to ip-api.com/batch.
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(); } - src/protocol/tools.ts:330-337 (registration)The tool definition and registration for 'geoip_batch' within the protocol tools collection.
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[])), }; - src/protocol/tools.ts:333-335 (schema)The input schema for 'geoip_batch' defining the expected list of IP addresses.
schema: { ips: z.array(z.string()).describe("IP addresses to geolocate (max 100)"), },