Inspiration
One in five Americans aged 65 and over reported not taking a medicine as prescribed because of its cost: not filling it, skipping doses, or taking less (Dusetzina et al., JAMA Network Open, 2023; a 2022 survey). In a JAMA study of 2013 claims (Van Nuys et al., 2018), the insured patient's copay was higher than the drug's cash price for more than a quarter of generic prescriptions. Since 2018 federal law has let pharmacists say when paying cash is cheaper, but only if the patient asks, and most people don't know there is anything to ask.
The people this affects most are the people a voice assistant suits best: older, on several medicines, and not likely to compare prices across three websites.
Measured, not anecdotal
On 20 October the add-on's own sources were asked about every tablet and capsule strength of the 37 common generics it keeps ready, 275 in all (docs/savings.md, made by tools/measure_savings.py):
- Cost Plus Drugs sells 35 of the 37 generics.
- Where it sells a strength, a month delivered costs $11.21 at the median, and 88% cost under $15.
- Three months in one fill comes to $4.38 a month at the median.
These are prices, not what anyone pays: copays vary by plan, and no public source lists them. Anyone whose copay is above the delivered price for their medicine is who the add-on is for, and the add-on tells them which side of that line they're on.
What it does
"Alexa, ask Fair Refill if I'm overpaying for my atorvastatin 20 milligrams. I pay forty dollars a month."
"You may be paying about $29 a month more than you need to for atorvastatin 20 mg tablet. Cost Plus Drugs delivers it for about $11 a month, or $3.83 a month if your doctor prescribes three months at once, and Amazon RxPass covers it for $5 a month with Prime, outside insurance. Cash prices usually don't count toward your deductible or Medicare's yearly limit. Ask your pharmacist whether paying cash would cost less than your insurance. They're allowed to tell you."
That is the add-on's real answer on 6 Oct 2026, from CMS's weekly price file and Cost Plus's price that day. It also:
- asks which one when a name is ambiguous ("Which atorvastatin do you take: 4 mg/ml liquid, 10 mg tablet, 20 mg tablet, 40 mg tablet, or 80 mg tablet?") and prices the exact choice;
- corrects a misheard name ("lipiter" to Lipitor) and says what it found;
- gives Medicare's 2026 negotiated price for the ten drugs that have one (Eliquis: $231 for 30 days, down from $521) and the $2,100 yearly cap;
- gives the price that starts on 1 January 2027 for the fifteen drugs CMS negotiated next ("From January 2027, Medicare's negotiated price for Ozempic is about $274 for a typical 30-day supply, down from a list price of $959"), and during Medicare open enrollment (15 Oct to 7 Dec) says that now is the time to check how each plan covers it;
- keeps a list of someone's medicines and checks them all at once, with a total;
- shows a card on devices with a screen: what you pay, the comparison price, the next step, and the sources.
How I built it
- An MCP server over Streamable HTTP with seven tools, written to Alexa+'s requirements for MCP add-ons: one tool per thing a person wants, a short spoken answer in every result, stable IDs for choices, and no error codes reaching the person.
- The card is an MCP App (
ui://fair-refill/card.html), served by the add-on itself. - An Agent Skill (
skills/fair-refill/) says how to hold the conversation around the tools and which rules an answer must keep. The add-on serves it as a resource too, and a test fails if the skill and the server's tools drift apart. - Four public sources, joined on the exact drug: RxNorm (National Library of Medicine) identifies the medicine and its package codes; CMS NADAC gives what pharmacies pay, weekly; the Cost Plus Drugs API gives a cash price anyone can buy at, for one month and for three; CMS's 2026 and 2027 fact sheets give Medicare's negotiated prices. Amazon RxPass is mentioned where its list includes the medicine, with its conditions.
- A simulated Alexa+ that uses the add-on as an MCP client, speaks its answers, and hosts its card on an Echo Show-style screen. Alexa+'s own developer tools are not open to entrants (friction log, entry 1), so this stands in for them. The add-on is the real thing; only the front end is simulated.
- Pre-warming. A first lookup touches three public APIs and took 6 to 12 seconds when measured on 6 Oct. The server looks up every strength of 53 commonly asked-about medicines when it starts and every five hours after, which made the same questions answer in under 100 ms through the simulator. A kept price is the source's own answer, at most 12 hours old.
- 139 tests, all offline: they replay 156 responses recorded from the live APIs, so they test real data without the network. CI runs them on Python 3.11 and 3.13.
Run it:
pip install -e .
python -m fair_refill.simulator # http://127.0.0.1:8765
The rules it keeps
This is health-adjacent, so what it refuses to do matters as much as what it does.
- The identical drug only. Two prices are compared only when both are for package codes of the same clinical drug: same ingredient, strength and form. It never suggests a different medicine, strength or dose, or skipping one. A test fails if an answer contains "switch to", "skip" or "take less".
- Brand to generic is a question for the pharmacist or doctor, never an instruction.
- A cash price is the price at the door. Cost Plus's quote leaves out $5.25 shipping an order, so that's added before anything is said or compared. Someone paying $9 a month is not told they're overpaying because a quote says $5.41.
- Three months at once is offered, not advised. Cost Plus charges its fee per fill and shipping per order, so three months in one fill costs far less per month ($3.83 against $10.66 for atorvastatin 20 mg). It needs a different prescription, so the answer says "if your doctor prescribes three months at once".
- A cash price comes with its catch. Money paid outside insurance usually doesn't count toward a deductible or Medicare's yearly limit, so someone on several medicines could pay less per refill and more over the year. Every answer that gives a cash price says so.
- Every figure says what it is (what pharmacies pay, a price you can buy at, or Medicare's price) and carries its date.
- It says what it can't do. Inhalers, liquids and creams are priced per gram or millilitre; it says it can't compare those yet instead of estimating.
- Every answer ends with a next step: the pharmacist, the doctor or the plan.
- A person's medicine list is theirs alone. Run locally, it stays on that machine. On a shared server each browser's list is kept under a random key only that browser holds, and a request without one gets no list.
What's next
- It has not run on Alexa+ itself, only against the simulator and generic MCP clients.
- Price comparisons cover tablets and capsules only. Injections and inhalers get an answer only where Medicare has negotiated a price for the brand.
- One cash-price source. Cost Plus doesn't carry every drug (Eliquis, for one), and for those the answer has no "you can buy it for" figure.
- The JAMA figure is from 2013 claims. It is the best published number and the answer to "is this still true" is what the add-on is for.
Log in or sign up for Devpost to join the conversation.