$npx -y skills add QSong-github/DrugClaw --skill dailymedQuery DailyMed for FDA drug label / package insert information. Use whenever the user asks about drug labeling, SPL documents, prescribing information, NDC codes, or needs to look up current FDA-approved drug details by name or NDC. Supports single entity or batch queries.
| 1 | # DailyMed Query Skill |
| 2 | |
| 3 | Search DailyMed SPL labels by drug name or NDC code. No API key required. |
| 4 | |
| 5 | | Input Type | Function | Returns | |
| 6 | |---|---|---| |
| 7 | | drug name (str) | `search_drug_labels(name, limit)` | list of label summaries | |
| 8 | | SPL set ID | `get_label_detail(set_id)` | dict (parsed from XML) | |
| 9 | | NDC code | `get_ndc_info(ndc, limit)` | list of label summaries (JSON) | |
| 10 | | str or list[str] | `query(entities, limit)` | concise text summary | |
| 11 | | list[str] | `search_batch(entities, limit)` | dict[entity → results] | |
| 12 | |
| 13 | ## API |
| 14 | |
| 15 | | Function | Input | Returns | |
| 16 | |---|---|---| |
| 17 | | `search_drug_labels(drug_name, limit=5)` | drug name string | `list[dict]` with `title`, `setid` | |
| 18 | | `get_label_detail(set_id)` | SPL set ID | `dict` (XML→dict, keys vary by label) | |
| 19 | | `get_ndc_info(ndc, limit=5)` | NDC string | `list[dict]` with `title`, `setid` | |
| 20 | | `search_batch(entities, limit=3)` | list of drug names | `dict[str, list[dict]]` | |
| 21 | | `summarize(results, entity)` | results list + label | compact text | |
| 22 | | `query(entities, limit=3)` | single str or list[str] | LLM-readable text block | |
| 23 | |
| 24 | ## Usage |
| 25 | |
| 26 | See `if __name__ == "__main__"` block in `06_DailyMed.py` for runnable examples covering: single drug search, batch multi-drug search, label detail retrieval, and NDC lookup. |
| 27 | |
| 28 | ## Quick Examples |
| 29 | |
| 30 | ```python |
| 31 | from importlib.machinery import SourceFileLoader |
| 32 | dm = SourceFileLoader("dm", "06_DailyMed.py").load_module() |
| 33 | |
| 34 | # Single entity |
| 35 | print(dm.query("metformin")) |
| 36 | |
| 37 | # Multiple entities |
| 38 | print(dm.query(["aspirin", "lisinopril", "atorvastatin"])) |
| 39 | |
| 40 | # Full label detail |
| 41 | hits = dm.search_drug_labels("metformin", limit=1) |
| 42 | detail = dm.get_label_detail(hits[0]["setid"]) |
| 43 | ``` |
| 44 | |
| 45 | ## Data Source |
| 46 | |
| 47 | - **Provider**: U.S. National Library of Medicine / DailyMed |
| 48 | - **Base URL**: `https://dailymed.nlm.nih.gov/dailymed/services/v2` |
| 49 | - **Auth**: None (public API) |
| 50 | - **Note**: Search (`/spls.json`) and NDC lookup (`/spls.json?ndc=...`) return JSON. Detail endpoint (`/spls/{setid}.xml`) is XML-only; parsed to dict automatically. |