enrich_ip
Resolve an IP address to its geographic location, returning country, region, city, ISP, timezone, and coordinates. Uses ipinfo.io or ipwho.is for public IPs, with explicit error handling for private or unavailable addresses.
Instructions
Geolocate an IP address over HTTPS.
Public IPs are looked up via ipinfo.io (if IPINFO_TOKEN is configured) or ipwho.is. Private/loopback addresses are classified locally. Vendor failures return error=geolocation_unavailable with null coordinates — never invented lat/lon.
Args: ip: IPv4 or IPv6 address (e.g. "8.8.8.8")
Returns: dict with keys: valid, country, country_code, region, city, isp, timezone, lat, lon, error (when unavailable), cost_usd
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ip | Yes |