# TollGuru MCP

> TollGuru calculates total trip costs, including tolls, fuel consumption, and driver wages across 50+ countries. This server lets your AI agent determine the most cost-effective route, optimize multi-stop deliveries, or analyze existing GPS map data (polylines). It handles everything from 2-axle cars to 9-axle commercial trucks.

## Overview
- **Category:** data-analytics
- **Price:** Free
- **Tags:** toll-calculation, route-optimization, fuel-estimation, fleet-management, geospatial-data, api-integration

## Description

TollGuru is your server for calculating total trip costs across different countries. You connect it to your AI client, and suddenly you're running a full logistics analysis right from chat. It handles everything required for commercial trucking and personal travel—from 2-axle cars all the way up to nine-axle haulers.

### Calculating Core Trip Costs

When you need to know what an origin-to-destination trip is gonna cost, use `calculate_toll_route`. This tool doesn't just give you a toll estimate; it gives you the whole financial picture. You input your start point and end point, and it returns the total expense, which includes tolls, estimated fuel consumption, and even driver labor costs based on hourly wages or time value. If you need to stop at intermediate points, you can include those optional waypoints in that same call; the server factors them all into the final budget.

Fuel cost estimation is precise because it accounts for your vehicle's specific MPG rating relative to the distance traveled. When you run `calculate_toll_route`, you get a breakdown of these components, letting you see exactly where your money goes. You don't just get a number; you get the mechanism behind that number. The tool determines costs tailored to your exact size—it knows if it's charging for a standard car or a heavy-duty 9-axle commercial rig.

### Optimizing Complex Deliveries

If you’re dealing with multiple drop-offs, don't waste time guessing the best order. Use `calculate_toll_multi_stop`. This tool takes a list of waypoints and figures out which sequence minimizes your total toll expenditure. It doesn't just spit out one possible route; it optimizes the entire delivery run for you to hit the lowest overall toll cost. You give it ten stops, and it tells you the best order to visit them in.

### Analyzing Existing Maps and Routes

What if your team already has a GPS track or map data—a polyline encoded by another mapping service? Don't re-route everything. Use `calculate_toll_from_polyline`. This function calculates tolls for an existing route you provide, making it perfect for post-trip analysis or integrating with other systems that dump coordinate strings. You feed it the coordinates, and it spits out the toll cost without needing to optimize the path itself.

### Why It's Better Than Manual Checks

The entire suite of tools allows your AI agent to act like a dedicated logistics analyst. You’re talking natural language to your client, and that client talks directly to TollGuru. It runs complex calculations—like combining fuel estimates, driver wage assessments, and variable toll pricing across 50+ countries—in seconds. This means you're eliminating the need to manually check multiple toll authority websites or juggle different spreadsheet formulas just to budget a single haul. You get the full picture in one place.

## Tools

### calculate_toll_multi_stop
Finds the total toll cost and suggests the optimized order for multiple waypoints in a delivery route.

### calculate_toll_from_polyline
Calculates tolls for an existing route defined by encoded coordinates from a mapping service (Google Maps, Here Maps).

### calculate_toll_route
Determines comprehensive costs, including tolls, fuel, and driver time, for an origin-to-destination trip with optional waypoints.

## Prompt Examples

**Prompt:** 
```
Calculate toll costs for a car trip from San Francisco to Los Angeles.
```

**Response:** 
```
Calculating toll costs for San Francisco to Los Angeles... Route distance: 383 miles, estimated drive time: 5h 45m. Toll plazas: Bay Bridge ($7.00 tag / $8.00 cash). Total toll cost: $7.00 with FasTrak tag, $8.00 cash. Estimated fuel cost: $42.50 (25 mpg vehicle, $3.50/gal). Total trip cost: $49.50-$50.50. Alternative routes available via I-5 (no tolls, longer distance) or CA-101 (scenic, similar tolls). Would you like a comparison of all route options?
```

**Prompt:** 
```
What are the toll costs for a 5-axle truck from Chicago to Detroit?
```

**Response:** 
```
Calculating toll costs for 5-axle truck Chicago to Detroit... Route distance: 283 miles, estimated drive time: 4h 30m. Toll plazas: Chicago Skyway ($8.40 tag / $9.60 cash), Indiana Toll Road I-80/I-90 ($22.50 tag / $26.80 cash). Total toll cost: $30.90 with tag, $36.40 cash. Estimated fuel cost: $98.00 (6 mpg truck, $4.20/gal diesel). Estimated driver cost: $135.00 (at $30/hour). Total trip cost: $263.90-$269.40. Would you like alternative routes with lower toll costs?
```

**Prompt:** 
```
Optimize a delivery route with stops in Philadelphia, Baltimore, and Washington DC starting from New York.
```

**Response:** 
```
Optimizing multi-stop route... Original order: New York → Philadelphia → Baltimore → Washington DC. Optimized order (lowest tolls): New York → Baltimore → Washington DC → Philadelphia. Total distance: 287 miles. Toll plazas: NJ Turnpike ($13.85 tag), Baltimore Harbor Tunnel ($4.00 tag), I-95 Delaware Memorial Bridge ($5.00 tag). Total optimized toll cost: $22.85 with tag, $28.25 cash. Savings from optimization: $6.40 in tolls. Fuel cost: $38.50. Total trip cost: $61.35-$66.75. Would you like detailed waypoint-by-waypoint breakdown?
```

## Capabilities

### Calculate tolls for a specific route
Determine total travel costs (tolls, fuel, driver labor) between an origin and destination point.

### Optimize multi-stop delivery routes
Reorder multiple waypoints to find the sequence that minimizes total toll expenditures for a delivery run.

### Estimate fuel costs by vehicle type
Determine necessary fuel expenditure based on the distance and the specific MPG rating of your vehicle.

### Analyze existing GPS map data (polylines)
Calculate tolls for a route defined by an encoded polyline, useful for post-trip analysis or integrating with other mapping services.

### Determine vehicle-specific pricing
Get accurate toll costs tailored to specific truck sizes, from 2-axle cars up to 9-axle commercial trucks.

## Use Cases

### Optimizing a multi-site delivery run
A logistics planner needs to deliver parts to five different sites in the day. Instead of calculating tolls for every possible order, they ask their agent to use `calculate_toll_multi_stop`. The tool instantly determines the most cost-effective sequence and provides the total toll savings compared to their original route.

### Planning a long cross-country road trip
A family is planning a 1,000-mile drive from Texas to Florida. They run `calculate_toll_route` through the AI client. The result immediately provides not just the tolls, but also an estimate for gas and driver time, giving them a total budget figure before they even pack.

### Analyzing old GPS tracking data
A fleet manager receives a polyline file from a vehicle that had an issue. They use `calculate_toll_from_polyline` to run the path through the server. This tells them exactly how much toll money was incurred on that specific, pre-mapped segment, which is crucial for billing.

### Comparing routes with different vehicle sizes
A construction company needs to move a 9-axle crane across state lines. They run `calculate_toll_route` specifying the truck size and comparing it against running the same route for a standard 2-axle car, instantly seeing the massive difference in toll costs.

## Benefits

- **Full Cost Visibility:** You get accurate cost breakdowns for all payment methods (tag vs. cash) instantly. The `calculate_toll_route` tool tracks this detail so you know exactly how much the toll will actually cost.
- **Optimization Power:** Stop guessing on multi-stop runs. Use `calculate_toll_multi_stop` to automatically reorder your waypoints and save money, minimizing total tolls across complex delivery routes.
- **Vehicle Specificity:** Costs aren't one-size-fits-all. The server supports specific vehicle types (2-axle cars up to 9-axle trucks), ensuring the toll calculation is correct for your rig.
- **Flexible Input Handling:** Don’t have a starting point? Use `calculate_toll_from_polyline` if you only have raw map coordinates, letting you analyze routes generated by other systems.
- **Global Coverage:** The cost breakdown supports over 12 currencies (USD, EUR, CAD, etc.) and covers 50+ countries. Budgeting becomes truly international.

## How It Works

The bottom line is you stop estimating trip costs. Your AI handles the complex logistics math in real-time.

1. First, subscribe to the TollGuru server and input your API key. (Free tier: 150 transactions/day with a corporate email.)
2. Next, invoke any of the three tools—`calculate_toll_route`, `calculate_toll_multi_stop`, or `calculate_toll_from_polyline`—via your preferred AI client.
3. The agent executes the calculation and returns a structured report containing total tolls (by payment method), estimated fuel costs, and optional driver labor time.

## Frequently Asked Questions

**How do I calculate tolls for a complex multi-stop trip using TollGuru?**
Use the `calculate_toll_multi_stop` tool. You provide the list of waypoints, and the server automatically determines the optimal order to minimize total toll costs.

**Does TollGuru calculate tolls for my truck size?**
Yes. The system supports vehicle-specific pricing, accurately calculating costs for everything from 2-axle cars to 9-axle commercial trucks.

**What if I already have a GPS map track? Should I use calculate_toll_from_polyline?**
Yes. If you don't want the AI agent to re-route your path, but just need the toll cost for an existing polyline (like from Google Maps), `calculate_toll_from_polyline` is the tool you need.

**Can TollGuru calculate fuel costs and driver wages?**
Yes. The `calculate_toll_route` tool incorporates estimates for fuel based on vehicle efficiency, plus optional calculation of driver labor costs into the total budget.

**When using calculate_toll_route, how do I get the cost breakdown for different currencies?**
You specify your desired currency in the request parameters. TollGuru supports over 12 major world currencies, including USD, EUR, CAD, and GBP. This lets you run cost estimates without manual conversion.

**If I use calculate_toll_multi_stop, does it just list my waypoints or optimize the order for me?**
The tool optimizes your route to minimize total tolls. You provide a series of stops, and TollGuru determines the most cost-effective sequence for those waypoints.

**How is payment method comparison handled when running calculate_toll_route?**
The result set includes a detailed breakdown comparing costs by payment type. You can instantly see the difference between using a transponder tag, paying with cash, or prepaid cards for any segment.

**What are the rate limits and transaction caps when I use calculate_toll_from_polyline?**
The free tier provides 150 transactions daily. For higher volume needs, check our documentation to upgrade your plan. The API handles throttling automatically if you exceed your current limit.

**Can my AI calculate the total toll costs for a road trip from New York to Boston?**
Yes! Use the `calculate_toll_route` tool with origin="New York, NY" and destination="Boston, MA". You can specify your vehicle type (2AxlesAuto for regular cars, 2AxlesEV for electric vehicles, or truck types like 5AxlesTruck for commercial vehicles). The API returns detailed toll plaza names, tag and cash costs for each plaza, total toll cost, fuel cost estimate, and optional driver cost. You can also request costs in different currencies and compare payment methods (tag vs cash vs prepaid card).

**How do I get toll costs for a route I already have from Google Maps?**
Use the `calculate_toll_from_polyline` tool with the encoded polyline from Google Maps. Set source="google" and paste the polyline string. This calculates tolls for your exact route without re-routing. You can also specify vehicle type and currency. This is perfect when you have an existing route and need toll costs for trip budgeting or fleet expense tracking.

**Can I optimize a multi-stop delivery route to minimize toll costs?**
Absolutely! Use the `calculate_toll_multi_stop` tool with your origin, destination, and comma-separated waypoints. Set optimize_waypoints="true" to let TollGuru find the most cost-effective waypoint order. The API returns the optimized route with total toll costs, fuel costs, and detailed plaza-by-plaza breakdown. This is essential for logistics planning, delivery route optimization, and fleet cost management.