# Radar MCP

> Radar is your location intelligence server for AI agents. It handles complex geospatial tasks, letting you convert addresses to coordinates, calculate precise routes and distances between multiple points, check if locations fall inside defined boundaries (geofencing), or pinpoint a user's general region just from an IP address.

## Overview
- **Category:** cloud-infrastructure
- **Price:** Free
- **Tags:** geolocation, spatial-lookup, routing, reverse-geocoding, mapping, api-integration

## Description

Radar handles everything geospatial for your AI agent. You're dealing with complex location math—address conversions, routing times, checking boundaries—without writing a single line of boilerplate code. This server gives you location intelligence so deep, it feels like having a dedicated GIS team hooked up to your client.

When you start working with addresses and coordinates, you can first clean up the raw input data using **`validate_address`**. It checks an entire address string for proper formatting before you use it anywhere else. You'll then convert human-readable street addresses into precise latitude and longitude pairs with **`forward_geocode`**. Need to go backward? Just give us raw coordinates, and **`reverse_geocode`** turns them back into a readable street address.

For navigation, you can calculate the exact driving distance and estimated time between two specific points using **`calculate_route_distance`**. If you're running complex logistics or managing multi-stop routes, use **`calculate_routing_matrix`**. It generates a full table showing travel times and distances from multiple starting origins to multiple ending destinations all at once.

When it comes to context, Radar lets you check exactly what’s going on geographically. You can find nearby points of interest (POIs)—think gas stations, restaurants, or specific businesses—by running **`search_places`** against a location. If you need to know if a coordinate falls inside a pre-defined zone, use **`search_geofences`**. This checks for active geographical boundaries. Furthermore, you can pull extra data about any location, like nearby weather conditions or established service areas, with **`get_location_context`**.

Need to know where an IP address is pointing? You just pass in the IP string, and **`ip_geocode`** spits out the estimated geographic region. And remember, if you're building a user experience that requires typed suggestions, **`autocomplete`** handles it by suggesting complete addresses or points of interest as your agent types them into the prompt.

Radar makes sure every location query—whether it’s validating an address structure, calculating multi-stop routes, or determining a region from an IP—is handled correctly and immediately. You just call the tool; we handle the messy geography.

## Tools

### autocomplete
Suggests complete addresses and points of interest as you type them out in the prompt.

### calculate_route_distance
Gets the total driving distance and estimated time between two specific coordinates or locations.

### calculate_routing_matrix
Generates a table of travel times and distances for multiple starting points to multiple ending points.

### forward_geocode
Converts a text address (like '1 Main St, City') into precise latitude and longitude coordinates.

### get_location_context
Retrieves extra data for a location, such as nearby weather or defined service boundaries.

### ip_geocode
Determines the geographic region based only on an IP address string.

### reverse_geocode
Takes raw latitude and longitude coordinates and converts them back into a readable street address.

### search_geofences
Checks for active, predefined geographical zones (geofences) near a specific set of coordinates.

### search_places
Finds nearby points of interest (POIs), like gas stations or restaurants, based on location.

### validate_address
Checks and cleans up a structured address to ensure it meets proper formatting rules before use in the system.

## Prompt Examples

**Prompt:** 
```
Geocode '1600 Amphitheatre Parkway, Mountain View, CA'.
```

**Response:** 
```
Calling Radar `geocode`, the coordinates are Latitude: 37.422, Longitude: -122.084.
```

**Prompt:** 
```
Find the driving distance between my office in San Francisco (lat, lng) and the San Jose airport.
```

**Response:** 
```
Using `get_routing`, the driving distance is approximately 45.2 miles, with an estimated travel time of 55 minutes, avoiding current traffic bottlenecks indicated by Radar.
```

**Prompt:** 
```
Locate the country based on the IP address 8.8.8.8.
```

**Response:** 
```
Using Radar's IP tool, `ip_geocode` resolves `8.8.8.8` to the United States.
```

## Capabilities

### Determine coordinates from addresses
The agent converts a human-readable street address into precise latitude and longitude pairs.

### Calculate travel metrics between points
You can calculate the exact driving distance and estimated time needed to get from one point to another, or manage complex multi-stop routes at once.

### Check boundaries (Geofencing)
The agent verifies if a given set of coordinates sits inside or outside specified geographical areas.

### Identify location from an IP address
You pass in an IP address and the server returns its estimated geographic location, typically down to the country level.

### Validate structured addresses
The agent cleans up raw input data and checks if an entire address string is valid and properly formatted for use.

## Use Cases

### A delivery driver needs the quickest path.
The dispatcher doesn't know the best route through three new stops. They ask their agent to run `calculate_routing_matrix` using all three addresses as origins and destinations. The agent returns a full matrix, telling them exactly which order minimizes total travel time.

### A user submits an incomplete address.
The app receives '123 Main St.' from the client. Before trying to save it, the agent runs `validate_address`. The tool flags the input as incomplete and prompts the user for the missing zip code, preventing a database error.

### A security team needs to track an IP range.
The system logs show suspicious traffic from an unknown IP. An analyst instructs their agent to run `ip_geocode` on that specific address. The server resolves it, showing the threat originated in a foreign country, allowing immediate action.

### A local store needs to check its service boundaries.
The marketing team wants to know if a proposed pop-up kiosk location is inside their established commercial district. They run `search_geofences` using the coordinates, and the tool confirms that the site falls within an active 'Commercial Zone A' boundary.

## Benefits

- Stop guessing location data. Use `forward_geocode` to convert any messy street address into reliable latitude/longitude coordinates for your database.
- Handle complex logistics planning instantly. The `calculate_routing_matrix` tool lets you compare delivery routes between ten stops in a single call, saving hours of manual spreadsheet work.
- Build smarter user flows by validating inputs. Running `validate_address` ensures that when a user submits an address, your application logic won't crash due to bad formatting.
- Know where your users are online. The `ip_geocode` tool resolves IP addresses into regional data, letting you understand your user base without collecting physical location permissions.
- Map out service areas with confidence. You can use `search_geofences` to confirm if a specific coordinate falls within the boundaries of a store or restricted zone.

## How It Works

The bottom line is: your AI client handles all the complex API calling; you just ask it what location intelligence you need.

1. First, enable the server integration on your Vinkius Marketplace account and add the Radar Publishable API Key.
2. Next, instruct your AI client to perform a location task (e.g., 'Calculate the driving distance between X and Y').
3. The agent calls the appropriate tool (`calculate_route_distance`), sends the coordinates/addresses, and you get back structured data like miles, minutes, or confirmation of an invalid address.

## Frequently Asked Questions

**How does Radar calculate routing times using calculate_route_distance?**
It calculates the driving distance and duration between two points based on modeled road networks, predicting travel time while accounting for current traffic data where possible.

**What is the difference between forward_geocode and reverse_geocode?**
Forward geocoding converts a written address ('123 Main St') into coordinates (lat/lng). Reverse geocoding does the opposite: it takes raw coordinates and turns them back into a readable street address.

**Do I need to use validate_address before forward_geocode?**
While not strictly required, running `validate_address` first is best practice. It cleans up the input string, increasing the chances that `forward_geocode` returns accurate results.

**Can ip_geocode tell me a user's exact physical location?**
No. The `ip_geocode` tool provides geographic estimates based on IP address ranges, typically pinpointing the country or general region, not an exact street address.

**How many points can calculate_routing_matrix handle?**
It is designed to compare multiple origins and destinations simultaneously. Check the specific documentation for supported input limits, but it handles complex network comparisons far better than single-call tools.

**If I use `forward_geocode` with an ambiguous or incomplete address, should I run `validate_address` first?**
Yes. Running `validate_address` cleans and structures the input data before you call `forward_geocode`. This ensures that the coordinates returned are based on a properly formatted and confirmed location.

**Are there rate limits if I use `autocomplete` frequently in one session?**
The Vinkius Marketplace handles standard throttling for basic usage. If your application requires very high call volumes, you'll need to review the official Radar documentation regarding enterprise-level rate caps.

**What types of information does `get_location_context` actually retrieve?**
`get_location_context` pulls more than just basic weather data. It retrieves defined geofence parameters and other relevant, context-specific local intelligence for the exact coordinates provided.

**Where do I find my Radar API key?**
Log into your Radar dashboard. Under 'Project Settings' or the dedicated API keys section, look for your 'Publishable Key'. This is the standard read-only key used for client integrations and MCP operations.

**Should I use the Publishable Key or the Secret Key?**
Always use the **Publishable Key** for this MCP server instance if possible, as the operations (geocoding, routing, lookup) are typically safe read-only spatial actions.

**Can it calculate multi-stop routes like a delivery app?**
Yes, but indirectly through distance comparisons. The basic routing API fetches times from Point A to Point B. The AI can chain these requests together to establish an estimated schedule contextually in your chat.