Skip to main content
Glama

smoking-cost-calculator

Read-onlyIdempotent

Compute the lifetime cost of a smoking habit — cigarettes per day × pack price × years — and compare it against what the same money would have grown to if invested at a given annual return. Returns total spent, annual spend (the 'quit today' figure), invested future value, and the opportunity-cost gap. Defaults to US averages: $7/pack, 20 cigarettes per pack. The CDC estimates total US smoking-related cost (medical + lost productivity) at $1.4 trillion/year — this calculator answers the personal version of that number.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pack_priceYesPrice per pack in dollars. The US average is ~$7 (mid-2024); NYC and a few high-tax states exceed $12; the cheapest states sit near $6.
years_smokedYesYears over which the habit continues. Use total years if you're modeling a lifetime habit (e.g. 30 for a smoker who started at 18 and is now 48).
cigarettes_per_dayYesCigarettes smoked per day. A pack-a-day habit is 20. Fractional values allowed (e.g. 10 for half a pack, 7 for a workweek-only habit).
cigarettes_per_packYesCigarettes per pack. Defaults to 20 (the US/EU standard). Override for 25-cigarette packs (Canada, Australia) or 10-cigarette packs.
annual_return_percentYesOptional expected nominal annual return on the alternative investment, as a percentage (e.g. 7 for 7%). Set to 0 to skip the invested-future-value comparison. 7% real or 10% nominal are common long-term US stock-market assumptions.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
daily_spendYesCost of cigarettes smoked per day, in dollars.
total_packsYesTotal packs purchased (total_cigarettes ÷ cigarettes_per_pack), rounded.
total_spentYesTotal nominal dollars spent on cigarettes over years_smoked.
annual_spendYesdaily_spend × 365. The 'you'd save $X/year if you quit today' figure.
total_monthsYesNumber of monthly contributions (years × 12, rounded to integer).
monthly_spendYesdaily_spend × 365 / 12.
invested_valueYesFuture value of investing the same monthly amount at annual_return_percent over years_smoked (end-of-month contributions). Equals total_spent when annual_return_percent is 0.
opportunity_costYesinvested_value − total_spent. Positive when the investment outgrows the cash spent (typical with positive return). Zero when return is 0%.
total_cigarettesYesTotal cigarettes consumed over the horizon (cigarettes_per_day × 365 × years).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.7/5.0
Behavior5/5

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

Beyond the read-only/idempotent annotations, the description discloses exact outputs (total spent, annual spend, invested future value, opportunity-cost gap), the default pack price and pack size, and the CDC context. These behavioral details help an agent set expectations accurately.

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

Conciseness5/5

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

Three sentences, front-loaded with the primary purpose, followed by outputs and defaults. No filler; every sentence carries functional value.

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

Completeness5/5

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

With an output schema present and all inputs documented, the description complements the structured data by explaining the calculation logic, default assumptions, and return semantics. It leaves no major gaps for an agent deciding to invoke the tool.

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?

The schema fully documents all five parameters with rich descriptions, so the baseline is 3. The description goes further by stating the formula 'cigarettes per day × pack price × years' and clarifies how annual_return_percent drives the opportunity-cost comparison, adding relational meaning not in the schema.

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 ('Compute'), names the resource (lifetime cost of a smoking habit), and gives the exact formula and return values, making it unambiguous and distinct from sibling cost calculators.

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?

The description does not name alternatives or exclusion scenarios, but it provides clear context: it defines the calculator's scope (personal lifetime cost), notes US-average defaults, and clarifies the optional investment comparison. This gives sufficient guidance without explicit alternative pointers.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources