Skip to main content
Glama

Discount / sale price calculator

calc_discount
Read-onlyIdempotent

Calculates sale prices after stacked percent or fixed discounts with optional tax/VAT, finds the discount percentage between old and new prices, and compares two deals by price per unit.

Instructions

Three shop maths jobs. sale: price after one or two stacked discounts (each a percent or a fixed amount) plus optional tax/VAT, with what you save and the effective total discount (stacked percents multiply). reverse: the discount % between an old and a new price. compare: which of two deals is cheaper per unit (price and amount of each). Money is rounded to the cent at each step like a till. Web version: https://s3eidat.github.io/discount-calc/

Input Schema

NameRequiredDescriptionDefault
nowNoreverse: the new price.
wasNoreverse: the old price.
modeNoWhich calculator.sale
unitNocompare: the unit name (kg, L, item…). Default "unit".
priceNosale: original price.
priceANocompare: price of deal A.
priceBNocompare: price of deal B.
amountANocompare: amount of deal A (e.g. 0.5 for 500 g when unit is kg).
amountBNocompare: amount of deal B.
discountNosale: first discount (percent by default).
taxPercentNosale: optional tax / VAT percent added after the discounts.
discountTypeNosale: first discount is a percent or a fixed amount.percent
extraDiscountNosale: optional second discount applied after the first.
extraDiscountTypeNosale: second discount type.percent

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 (readOnly, idempotent, closed-world), so the description's real contribution is computational behavior: stacked percents multiply, tax/VAT is applied after discounts, and money is rounded to the cent at each step like a till. Those rules materially affect results and are not in the schema. Return shape is only loosely sketched ('what you save', 'effective total discount').

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?

Front-loaded one-line summary followed by three compact mode clauses; nearly every phrase carries information. The trailing web-version URL is marginally useful context rather than tool-selection content, slightly diluting an otherwise tight description.

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?

With 14 optional parameters and no output schema, the description does a good job mapping parameters to modes and hinting at returns (savings, effective total discount, cheaper-per-unit winner). It never gives an exact result shape for compare mode (e.g. per-unit prices for A and B), which is the remaining gap.

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 per-parameter text is already handled (baseline 3). The description adds ordering semantics the schema cannot express: the second discount applies after the first, percents stack multiplicatively, and tax is added after discounts. The compare example ('0.5 for 500 g when unit is kg') also clarifies unit/amount relationship.

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?

Opens with a concrete framing ('Three shop maths jobs') and then names each mode with a specific computation: sale price after stacked discounts plus tax, reverse discount percent between two prices, and per-unit deal comparison. An agent can tell exactly what this does and how it differs from generic siblings like calc_percentage or calc_split_bill.

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?

Each mode is prefixed with its purpose ('sale:', 'reverse:', 'compare:'), which effectively tells the agent which mode to pick for which question. There is no explicit when-not guidance or named alternative tool (e.g. vs calc_percentage), so it stops short of a 5.

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