Skip to content
healthcare.dev

Build drug recall and shortage alerts from FDA data

Pharmacies, clinics and inventory tools need to know the day a product they stock is recalled or goes short. The FDA publishes both; this keeps a watchlist against them.
Data
NDC
Endpoints
/v1/drugs/recalls
/v1/drugs/shortages
MCP tools
check_drug_recalls, check_drug_shortages
Plan
Runs on the Free plan

How it works

  1. Keep the NDCs you stock (product level, like 0002-1433).
  2. Once a day, look up recalls for each NDC reported since your last run.
  3. Look up current shortages for the same NDCs.
  4. Alert on anything new, Class I recalls first.

The code

TypeScript with @healthcare.dev/sdk. Set HDEV_API_KEY to a free key and run it. Every response carries its source, release and license in meta.

TypeScript
import { HealthcareDev } from "@healthcare.dev/sdk";

const hdev = new HealthcareDev();

export async function checkWatchlist(ndcs: string[], since: string) {
  const alerts = [];
  for (const ndc of ndcs) {
    const recalls = await hdev.drugs.recalls({ ndc, from: since });
    for (const r of recalls.data)
      alerts.push({
        ndc,
        kind: `Class ${r.classification ?? "?"} recall`,
        firm: r.recalling_firm,
        reason: r.reason_for_recall,
        lots: r.code_info,
      });
    const shortages = await hdev.drugs.shortages({ ndc, status: "current" });
    for (const s of shortages.data)
      alerts.push({ ndc, kind: "shortage", detail: s.availability, reason: s.shortage_reason });
  }
  return alerts.sort((a, b) => a.kind.localeCompare(b.kind)); // Class I first
}

await checkWatchlist(["0002-1433", "0006-0277"], "2026-10-01");

Or ask your agent

Connect the MCP server and ask in plain language. It calls check_drug_recalls, check_drug_shortages and cites what it found.

Prompt
Are there any FDA recalls or current shortages for NDC 0002-1433? Give the class, firm and reason.

Take it further

  • Use classification: "I" to page someone only for the most serious recalls.
  • Join recalls to your inventory by NDC-11 with the ndc11s field.
  • Search shortages by therapeutic_category to spot trouble across a drug class.

Reference data only, not medical advice or a coverage determination. Send codes, NDCs and NPIs, never patient information.

More examples