Get the caller's approximate location via IP
bus_get_my_locationIdentify your city-level location from your public IP to determine your city and enable nearby bus stop lookups.
Instructions
Resolve the caller's approximate location from their public IP — useful when the user asks something like "what's near me" without providing coordinates.
Precision is city-level (typically a few kilometres). Good enough to identify the city and seed bus_get_nearby_stops with a starting guess. NOT precise enough to find the user's actual bus stop — for that, ask for a landmark/address and resolve it via bus_search.
Caveats:
Resolves via ip-api.com (free tier; rate-limited but no auth).
VPN / corporate proxy → result reflects the proxy exit IP, not the user.
Cellular IPs often land on a provincial centroid.
Args:
ip (string, optional): a specific IPv4/IPv6 to look up. Omit to use the mcp server process's own outbound IP (= the caller's machine when running locally).
response_format ('markdown' | 'json')
Returns (json): { "lat": 31.2222, "lng": 121.4581, "gpsType": "wgs", "city": "上海", "region": "上海市", "country": "中国", "ip": "116.236.0.1", "isp": "China Telecom", "precision": "city-level (~10 km); not suitable for stop-level queries" }
Suggested workflow:
Call this tool to identify the user's city (match 'city' field against bus_list_cities to get a cityId).
Pass lat/lng into bus_get_nearby_stops for a rough nearby list, OR ask the user to confirm a landmark and use bus_search.pois for sharper coordinates.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ip | No | Optional override IP to look up. Omit to use the mcp server's own outbound IP (i.e. the caller's machine). | |
| response_format | No | Output format: 'markdown' for human-readable text, 'json' for full structured data | markdown |