# Route4Me MCP

> Route4Me connects your AI client to complex fleet logistics. It solves multi-stop route optimizations, tracks real-time vehicle GPS data, and lets you adjust driver manifests directly via chat commands.

## Overview
- **Category:** data-analytics
- **Price:** Free
- **Tags:** route-optimization, fleet-management, gps-tracking, delivery-logistics, dispatch-automation, fuel-efficiency

## Description

You connect your AI client directly to **Route4Me**, and it turns your agent into a full-time dispatcher that handles complex fleet logistics through simple chat commands. You're dealing with multi-stop routing, real-time tracking, and changing manifests—this server lets you do all that stuff.

To build any route, you first convert addresses to coordinates using `geocode_address`. This tool takes a messy, free-form street address and spits out precise geographic latitude **and** longitude pairs. Once you've got those coords, you can run an optimization job by calling `create_optimization_problem`, passing in parameters and all your destination locations to build the initial route plan. You won't wanna lose track of what routes you ran; use `list_optimizations` to see every solved **and** pending problem, then pull full details for any specific run with `get_optimization_problem`.

To monitor things once they’re moving, start by listing all registered hardware using `list_fleet_vehicles`. You can check what trips are currently active in the field by running `list_dispatched_routes`. For live updates, you pull real-time or historical GPS location data for any assigned run with `get_route_gps_tracking`. If you need to know the sequence of stops and when they're supposed to arrive, use `get_route_manifest` against a specific route ID. 

When things go sideways out on the road—and they always do—you need quick controls. You can add an unexpected delivery stop directly into an active driver’s day using `insert_stop_into_route`. If a whole trip gets canceled, you permanently remove it from the system with `delete_dispatched_route`.

Basically, you use these tools to manage the entire flow: first, geocode addresses; then, build and retrieve an optimization plan; next, list active routes and track them via GPS; finally, adjust the manifest by adding stops or deleting whole trips. You don't write complex API calls—you just talk to your agent.

## Tools

### create_optimization_problem
Builds a new route optimization plan by accepting parameters and multiple destination addresses.

### delete_dispatched_route
Permanently removes an entire dispatched route from the system.

### geocode_address
Changes a free-form address string into verifiable geographic coordinates (latitude and longitude).

### get_optimization_problem
Retrieves the full details for a specific route optimization plan ID.

### get_route_gps_tracking
Gets real-time or historical GPS location data for any specified route.

### get_route_manifest
Pulls the complete list of stops and estimated times for a defined route ID.

### insert_stop_into_route
Adds a new stop directly into an existing, active driver's planned route.

### list_dispatched_routes
Lists every single route that is currently marked as dispatched and active in the system.

### list_fleet_vehicles
Retrieves a list of all vehicles registered within your account's fleet management records.

### list_optimizations
Lists both active and historical route optimization problems that have been solved or are pending.

## Prompt Examples

**Prompt:** 
```
List all the recently dispatched deliveries today.
```

**Response:** 
```
I requested the dispatched lines pulling from `list_dispatched_routes` actively running through the system right now. Your dashboard indicates 3 live operational path allocations containing total multi-stop parameters. Let me know if you would like to drill down into a particular Route ID to see estimated times or locations manually.
```

**Prompt:** 
```
Bring me the ETA and all address details for route '8B9A64'.
```

**Response:** 
```
I requested the specific navigational matrix via `get_route_manifest` exclusively mapping to path '8B9A64'. The response contains 5 progressive destinations. Your requested vehicle has completed block 1, passing Main Street. Below is its progressive ETA log structure breaking down the following 4 remaining geographical nodes including targeted contact mapping details efficiently parsed:
```

**Prompt:** 
```
Please geocode the location '123 Main St, New York, NY, 10001'.
```

**Response:** 
```
I submitted the textual string through the `geocode_address` algorithmic logic. It precisely matched the parameter converting it effectively into verifiable numerical tracking values. Your coordinates output confirms standard positioning: Latitude 40.750, Longitude -73.996.
```

## Capabilities

### Calculate and retrieve optimal routes
The agent runs optimization problems to find the most efficient path given multiple stops, retrieving details with `get_optimization_problem`.

### Monitor live vehicle status
Query real-time or historical GPS location data for any assigned route using `get_route_gps_tracking`.

### Manage active trip details
List all ongoing routes (`list_dispatched_routes`) and pull the full list of stops and expected arrival times with `get_route_manifest`.

### Modify a route on the fly
Add unexpected new deliveries to an active driver's day using `insert_stop_into_route`, or remove an entire dispatched trip via `delete_dispatched_route`.

### Convert addresses to coordinates
The agent takes a plain address string and converts it into precise geographic latitude/longitude pairs using `geocode_address`.

## Use Cases

### The Urgent Change
A warehouse manager gets an emergency high-priority order. Instead of calling the dispatcher, they simply tell their AI client: 'Insert a stop at 55 Elm Street into Route ID XYZ.' The agent runs `insert_stop_into_route`, updates the manifest, and recalculates the remaining route time—all in chat.

### The Daily Status Check
An operations lead needs to know how many routes are currently active. They ask their agent to run `list_dispatched_routes`. The server replies with a list of IDs, allowing the lead to then use `get_route_manifest` on any specific ID for details.

### The Data Prep Job
A logistics engineer receives a spreadsheet with 500 raw addresses. Instead of paying for bulk geocoding services, they feed the list to their AI client and run `geocode_address` on batches, getting clean Lat/Long data back immediately.

### The Performance Review
A team wants to know how long a specific delivery path took last week. They use `list_optimizations` to find the historical record ID, then call `get_optimization_problem` using that ID to analyze the planned vs. actual route performance metrics.

## Benefits

- Instant Status Updates: Use `get_route_manifest` to pull the full stop list and ETAs for any route ID without logging into a dashboard. You just ask your agent.
- Dynamic Route Modification: Need to add an urgent drop-off? Instead of re-running massive calculations, use `insert_stop_into_route` to inject a new stop directly into an active day's schedule.
- Accurate Location Data: Never guess where a truck is. Get live or historical tracking data instantly via `get_route_gps_tracking`, giving you precise situational awareness.
- Pre-Flight Planning: Before dispatching, run scenarios using `create_optimization_problem`. You can then review the planned results with `list_optimizations` to guarantee efficiency and minimum fuel use.
- Data Cleanup: Don't waste time manually converting addresses. Use `geocode_address` to turn any raw street string into usable GPS coordinates for planning or data ingestion.

## How It Works

The bottom line is: you talk to your AI client, and the server runs complex logistics calculations or data pulls in response.

1. Attach the Route4Me logistics module to your MCP environment.
2. Sign in with administrative dispatch credentials to retrieve your secure API key and enter it into the configuration matrix.
3. Instruct your agent using natural language commands, such as 'Give me the real-time GPS ping for Route ID 123' to execute tool calls.

## Frequently Asked Questions

**How do I check if my route is active using list_dispatched_routes?**
You use `list_dispatched_routes` to pull a roster of all routes currently marked as dispatched. This tool gives you the IDs and basic statuses of every operational path right now.

**Is get_route_manifest better than list_dispatched_routes?**
Yes. `list_dispatched_routes` just tells you which routes exist. Use `get_route_manifest` when you need the actual details: the full sequence of stops, the estimated time windows, and the specific destinations for a known route ID.

**Can I run optimization without knowing all addresses?**
No. The `create_optimization_problem` tool requires you to provide a structured JSON object containing all necessary parameters and destination addresses upfront for it to calculate anything.

**What if I need to change an active route's stop?**
Use `insert_stop_into_route`. This tool adds the new delivery into the existing sequence, automatically adjusting the rest of the manifest and estimated times for the driver.

**Does get_route_gps_tracking work only with live data?**
No. It retrieves both real-time telemetry *and* historical GPS tracking data. You can track a truck's movements over the last 24 hours or see its current location on demand.

**What are the risks of using the `delete_dispatched_route` tool?**
The action is irreversible, so exercise caution. This function permanently removes a dispatched route from your system. Always confirm that you want to delete the entire operational path before calling it.

**How do I verify my API connection using `list_fleet_vehicles`?**
Run `list_fleet_vehicles` to test your connection and permissions immediately. If the tool returns a list of registered vehicles, your API key is valid and you have full access to fleet data.

**How do I check historical route performance with `list_optimizations`?**
The tool provides a comprehensive record of all past optimization problems. This lets you review the parameters and outcomes of previous planning sessions without needing specific IDs.

**Can the AI automatically assign drivers to newly generated routes?**
This particular capability set focuses heavily on querying navigational routes, analyzing optimizations, and live tracking variables. Assigning specific user accounts or driver individuals to dispatched routes typically requires organizational-level management directly performed through your centralized Route4Me web board to appropriately handle real payroll, licensing, or schedule complications instead of conversational automation.

**How does `get_route_gps_tracking` update if the vehicle goes offline?**
If a Route4Me integrated tracking application or native vehicular telematics unit temporarily loses signal, the platform caches the latest recorded ping. Therefore, running the tracking querying task via the AI returns the last reliable known geographical timestamp instead of an extrapolated error, keeping expectations transparent to operational visibility parameters.

**Can I add a new stop to an already-active route without re-optimizing everything?**
Yes. The `insert_stop_into_route` tool lets you inject a new address into an existing dispatched route. The platform appends it without recalculating the full optimization, keeping the rest of the sequence intact.