# Tip Splitter MCP MCP

> Deterministic Fair-Share Tip Splitter calculates complex restaurant bills precisely. It splits costs based on individual items consumed, then proportionally applies taxes and tips across all parties. Crucially, it resolves fractional penny discrepancies automatically, guaranteeing 100% mathematical closure for the entire group.

## Overview
- **Category:** productivity
- **Price:** Free
- **Tags:** math-precision, billing, tax-calculation, ledger, financial-tools

## Description

Splitting a bill after dinner is always math-heavy. When you have shared appetizers alongside specific drinks, plus tax and tip percentages, general AI models struggle; they often hallucinate decimal distributions or fail to balance the final total. This MCP handles that exact calculation using an internal V8 engine. It first maps consumption: it knows if Nachos were for two people or just one. Then, it calculates each person's base share. Finally, it takes care of the secondary rates—tax and tip—by distributing them proportionally across everyone’s calculated total. If a fractional cent leaves a discrepancy between the individual shares and the actual receipt amount, the MCP automatically reconciles that penny. You can connect this through Vinkius and let your agent handle financial math that usually requires an Excel sheet.

## Tools

### split_bill
This function calculates individual shares by accepting a JSON array of items, total tax amounts, and tip percentages for proportional distribution.

## Prompt Examples

**Prompt:** 
```
Split this bill: Burger ($15) for Alice, Salad ($12) for Bob, and shared Nachos ($10) for both. Tax is $3.50 and tip is 20%.
```

**Response:** 
```
Using the split_bill tool: The grand total is $47.90. Alice owes $25.89 (base: $20.00) and Bob owes $22.01 (base: $17.00).
```

**Prompt:** 
```
Three of us had a $90 steak dinner (all shared). Tax $8, tip 15%. How much each?
```

**Response:** 
```
Using the split_bill tool: The grand total is $111.50. Thanks to the Penny Reconciliation Algorithm, Person 1 pays $37.16, while Person 2 and Person 3 pay $37.17 each to exactly cover the bill.
```

**Prompt:** 
```
Calculate the fair split for a $45 bill where John had a $30 wine and Sarah had a $15 pasta. Tax $4, tip 18%.
```

**Response:** 
```
Using the split_bill tool: Since John's base item was 66.6% of the bill, he correctly absorbs 66.6% of the tax and tip burden. John owes $38.07, and Sarah owes $19.03. Grand total: $57.10.
```

## Capabilities

### Calculate proportional cost splits
The tool determines each person's share of the bill, correctly distributing taxes and tips based on individual items.

### Handle shared item costs
It dynamically maps a single menu item to multiple consumers, splitting its cost before applying any secondary rates.

### Reconcile penny discrepancies
The MCP guarantees 100% mathematical closure by automatically adjusting for missing or extra fractional cents in the total.

## Use Cases

### The client dinner needs splitting
A PM receives a bill for three people: Client A had wine ($30), Client B had salad ($12), and all shared nachos ($10). The agent uses `split_bill` with the tax and tip percentages to determine that Client A owes $38.07, and Client B owes $19.03. It's instant.

### Handling purely shared group costs
Three colleagues share a large steak dinner ($90). They need to split the total cost plus tax and tip. The agent runs `split_bill` and gets a precise breakdown, ensuring the final payments of $37.16 and $37.17 perfectly match the bill's grand total.

### Reconciling complex vendor invoices
A small business owner receives an invoice for shared catering ($45). They need to know how much tax/tip applies proportionally if one department used $30 worth of food and another used $15. Using `split_bill` gives them the exact allocation percentage.

### Comparing cost estimates
An architect needs to estimate costs for a meeting involving shared catering and individual coffee orders. They run `split_bill` with sample numbers, allowing their agent to immediately compare potential expenditures across different scenarios.

## Benefits

- Stop manually balancing books. The `split_bill` function handles the entire math process, eliminating rounding errors that mess up expense reports.
- It correctly accounts for mixed consumption. If one person orders a drink and two share an appetizer, the MCP splits those costs accurately.
- You get guaranteed mathematical closure. When fractions of a penny cause discrepancies between individual totals and the receipt grand total, this MCP fixes it automatically.
- The calculation is fast and deterministic. Since it runs natively in V8, you don't wait on heavy external library calls; the result comes through instantly.
- It separates base costs from overhead. It first splits out the cost of goods sold, then proportionally applies the tax and tip burden.

## How It Works

The bottom line is that you get an accurate cash-out statement without having to manually solve complex algebra.

1. You provide the list of items, who ordered them, and the tax rate/tip percentage.
2. The MCP processes the inputs through its V8 engine, calculating base shares for all consumers and mapping shared item costs.
3. It returns a final breakdown showing exactly how much each person owes, including the reconciled total.

## Frequently Asked Questions

**How does deterministic fair-share tip splitter handle shared items?**
The MCP maps the item first. When you use `split_bill`, it determines that a shared item, like Nachos, is split proportionally among all listed consumers before calculating the individual base costs.

**Is this tool better than just splitting by equal shares?**
Yes. If you divide expenses equally, you ignore consumption differences and fail to allocate tax/tip proportional to usage. This MCP calculates based on actual item value.

**Does the split_bill function fix penny rounding issues?**
Absolutely. The core strength of this tool is its reconciliation algorithm; it guarantees that the sum of all individual payments equals the original grand total, even down to the cent.

**What inputs does I need for split_bill?**
You must provide three things: a JSON array detailing the items and who ordered them, the total tax amount, and the tip percentage.

**How does using the split_bill function perform when handling many line items?**
The calculation is extremely fast because it runs natively within a rigorous V8 mathematical engine. This guarantees quick, deterministic results even with complex ratios and numerous consumed items.

**If my bill details are incomplete, what happens when running split_bill?**
The tool requires all necessary inputs, including the total taxAmount and tipPercentage. Providing partial or malformed data will trigger an immediate validation error, preventing any inaccurate calculations.

**Is the split_bill function compatible with various AI agents and clients?**
Yes. Because this MCP adheres to the Model Context Protocol standard, any AI client connected via Vinkius can access and use it. It works regardless of your agent's underlying technology.

**Does split_bill support currencies other than USD?**
The core mathematical engine supports various currency formats. You just need to ensure that the input data you pass to the function is correctly structured and formatted for calculation.

**How does it handle shared items like an appetizer?**
The agent passes an array of 'consumers' for each item. If 'Nachos' ($15) has consumers ['John', 'Jane'], the engine automatically divides the base cost ($7.50 each) before proportionally applying their individual tax and tip burden.

**Why do LLMs fail at this without an MCP?**
LLMs lack true mathematical persistence. When calculating multi-step proportions (subtotal -> ratio -> tax allocation -> tip allocation -> fractional rounding), they often lose tracking of pennies, resulting in individual totals that don't add up to the receipt's grand total.

**What is the 'Penny Reconciliation Algorithm'?**
Due to floating-point `toFixed(2)` rounding on 5 different people, the sum of individual owed amounts might equal $100.01 while the actual grand total is $100.00. The engine detects this and surgically subtracts or adds the penny discrepancy to guarantee an exact match.