Skip to main content
Glama

Split a bill

calc_split_bill
Read-onlyIdempotent

Split a restaurant bill with tax, service, and tip into exact whole-cent shares that always add up. Supports even or itemized splits, proportional tax/tip, and rounding each share up.

Instructions

Split a restaurant bill with tax/service and tip, in whole cents so the shares always add up exactly (left-over cents go to the largest remainders). simple: one bill split evenly between N people (1–100). items: list who had what; each item is split between the people who shared it (nobody listed = everyone), and tax and tip are shared in proportion. Tip can be on the subtotal or on subtotal + tax; each share can be rounded up to a step (e.g. 0.5 or 1). Returns a ready-to-send summary. Web version: https://s3eidat.github.io/split-bill/

Input Schema

NameRequiredDescriptionDefault
billNosimple: the bill subtotal (before tax and tip).
modeNoEven split, or itemised.simple
itemsNoitems: what was ordered.
peopleNosimple: how many people (default 2). items: the names, e.g. ["Sara", "Omar", "Lina"].
currencyNoCurrency, e.g. "JOD" (written after) or "$" (written before).
tipOnTaxNoCalculate the tip on subtotal + tax.
roundUpToNoRound each share up to a multiple of this (e.g. 0.5, 1, 5). 0 = exact.
taxPercentNoTax / service charge percent.
tipPercentNoTip percent (default 10).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.3/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already cover the safety profile (readOnlyHint, idempotentHint, openWorldHint=false), so this is extra credit territory, and the description delivers: it discloses the cent-allocation algorithm (left-over cents to largest remainders), that tax and tip are shared proportionally in items mode, that tip can be computed on subtotal or subtotal+tax, and that each share may be rounded up to a step. It doesn't mention validation failures (e.g. max 200 items, max 100 people) beyond the simple-mode range, keeping it out of the 5 tier.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The core behaviour (whole-cent allocation and the mode split) is front-loaded in the first two clauses, and the sentences are dense but all load-bearing. The trailing 'Web version:' URL is decorative rather than useful for an agent and is the only clear waste.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 9-parameter, entirely optional-parameter tool with no output schema, the description supplies what the schema can't: mode semantics, the cent-rounding guarantees, and a statement of the return value ('a ready-to-send summary'). Nothing an agent needs in order to call it correctly appears to be missing, though it doesn't cover default behaviour when `bill` is omitted.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3, but the description earns one more by explaining cross-parameter interaction the schema can't: how `items` + `sharedBy` propagate into per-person splits and how tax and tip get apportioned proportionally across those shares. It also clarifies the roundUpTo/tipOnTax behaviour in prose rather than merely restating the field descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a specific verb+resource: splitting a restaurant bill with tax/service and tip, computed in whole cents. It immediately distinguishes the two operating modes (simple even split vs. itemised) and states the guarantee (shares always add up exactly), which is enough for an agent to identify this tool against any sibling in the long calc_* family.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It clearly states the conditions that select each mode — 'simple: one bill split evenly between N people (1–100)' vs. 'items: list who had what' — and explains the default when nobody is listed for an item. It stops short of naming alternatives or exclusions, but no sibling tool competes for this job, so the routing guidance is effectively complete.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools