# Deterministic Fair-Share Tip Splitter MCP for AI Agents AI Agent Connect

> Deterministic Fair-Share Tip Splitter turns your AI into a precise ledger for group dining. It handles the math of shared appetizers, individual drinks, and complex taxes. It ensures every cent is accounted for so you don't have to manually double-check the math on a messy receipt. Perfect for group dinners where the bill is complicated and the math needs to be perfect.

## Overview
- **Category:** productivity
- **Price:** Free
- **Endpoint:** https://edge.vinkius.com/vk_preview_8HLUdnAaXQJO4EgNA42edHGNO0scKItSo0N7Ebqj/ai-agent-connect
- **Tags:** math-precision, billing, tax-calculation, ledger, financial-tools

## Description

This Connector handles the math of restaurant bill splitting. Splitting a bill with shared appetizers, individual drinks, and group tips is a mathematical nightmare. Most AI models frequently hallucinate decimal distributions and fail to balance the final grand total, leading to awkward conversations at the end of a meal. It offloads that exact calculation to a rigorous V8 mathematical engine that prioritizes precision. It handles the nuances of shared items, allowing you to map a single dish like nachos to multiple people. The engine then dynamically splits the price before applying the correct tax and tip burdens to each individual based on their specific consumption. When fractional cents create a discrepancy between the calculated totals and the actual receipt, the engine automatically reconciles the missing or extra penny to guarantee 100% mathematical closure. This means no more guessing or manual rounding. It's built for speed and precision without pulling in heavy external libraries. You'll find it's a reliable way to handle group finances as part of the Vinkius catalog, giving your agent a robust way to handle complex receipts. It turns a tedious, error-prone process into a single command that delivers a clean, verified ledger for everyone involved. It's the difference between a rough estimate and a perfectly balanced bill that everyone can agree on instantly.

## Tools

### split_bill
Calculates individual shares for a complex receipt including shared items, taxes, and tips. It ensures the final sum matches your total perfectly.

## Prompt Examples

**Prompt:** 
```
We had a $50 pizza shared by 4 people, $20 wings for 2 of us, and a $10 salad for 1. Tax is $5 and tip is 18%. Who owes what?
```

**Response:** 
```
### Bill Breakdown

| Person | Base Items | Share | Total Owed |
| :--- | :--- | :--- | :--- |
| Person 1 | Pizza (Shared) | $12.50 | **$14.88** |
| Person 2 | Pizza (Shared) & Wings | $17.50 | **$20.10** |
| Person 3 | Pizza (Shared) | $12.50 | **$14.88** |
| Person 4 | Pizza (Shared) | $12.50 | **$14.88** |

*Note: The total was balanced using the penny reconciliation algorithm to match the receipt exactly.*
```

**Prompt:** 
```
Split a $100 bill where Alice had $40 of food and Bob had $60. Tax is $10, tip is $20.
```

**Response:** 
```
### Final Totals

* **Alice owes: $55.00** (Base $40 + $15 tax/tip)
* **Bob owes: $65.00** (Base $60 + $20 tax/tip)

**Grand Total:** $120.00
```

**Prompt:** 
```
Three people shared a $90 steak. Tax $8, tip 15%. How much each?
```

**Response:** 
```
### Shared Bill Calculation

Since the steak was shared equally, the costs are split as follows:

* **Person 1:** $37.16
* **Person 2:** $37.17
* **Person 3:** $37.17

**Total:** $111.50

*The difference of $0.01 between the participants was automatically reconciled to ensure the grand total of $111.50 is covered exactly.*
```

## Capabilities

### Split shared items
Maps a single dish like appetizers or drinks to multiple people for fair cost division.

### Distribute taxes proportionally
Applies the exact tax burden to each person based on the percentage of the bill they consumed.

### Reconcile penny discrepancies
Automatically adjusts the final totals to ensure the sum of individual shares matches the receipt exactly.

### Calculate individual shares
Determines the base cost for each person based on the specific items they ordered.

### Apply custom tip percentages
Distributes a group tip proportionally across all individual totals.

## Use Cases

### The Office Lunch
An office manager wants to split a catering bill where 5 people shared a salad but only 2 had sandwiches. They use split_bill to get an exact breakdown.

### The Vacation Dinner
A group of 4 friends wants to split a wine and appetizers shared by all, plus individual entrees. The agent uses split_bill to handle the proportional tax.

### The Shared Appetizer
Someone wants to know the exact cost of a $20 nacho plate shared by 4 people plus a 10% tip. The agent calculates the share per person instantly.

### The Precise Tax Split
A user needs to ensure that someone who only ordered a $5 drink pays a fair share of a $10 tax. The agent uses split_bill to distribute it fairly.

## Benefits

- Stop worrying about math errors because the V8 engine handles decimal precision for you.
- Get fair results for shared items by using split_bill to map one dish to multiple people.
- Eliminate who owes what arguments with a clear breakdown of tax and tip for every person.
- Ensure the total always matches the receipt thanks to the automatic penny reconciliation.
- Save time by letting your agent handle the tedious calculation of proportional percentages instantly.

## How It Works

The bottom line is you get a mathematically perfect bill split that actually adds up to the total on your receipt.

1. Provide the itemized receipt and the list of people involved.
2. Describe who shared which items and the total tax and tip amounts.
3. Get a precise breakdown of exactly what each person owes.

## Frequently Asked Questions

**Can the Deterministic Fair-Share Tip Splitter handle shared appetizers?**
Yes, it can map a single item to multiple people. This ensures that shared costs are split correctly before taxes and tips are applied.

**How does the Deterministic Fair-Share Tip Splitter handle taxes?**
It distributes taxes proportionally. This means the person who ordered the most expensive meal pays a larger share of the total tax.

**Will the Deterministic Fair-Share Tip Splitter make sure the total is correct?**
Yes, it uses a reconciliation algorithm to ensure the sum of all individual shares matches the grand total on your receipt perfectly.

**Can I use the Deterministic Fair-Share Tip Splitter for office catering?**
Absolutely. It's perfect for dividing catering costs among a team where some people shared dishes and others had individual plates.

**Does the Deterministic Fair-Share Tip Splitter work for large groups?**
Yes, it can handle any number of people and items, making it ideal for large group dinners or parties.

**What happens if the math doesn't add up perfectly?**
The Connector automatically reconciles the missing penny. This ensures that the final amount everyone pays covers the total on the bill without any leftover cents.

**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 Connector?**
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.

**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.