$npx -y skills add QSong-github/DrugClaw --skill openfdaQuery FDA drug labeling data via openFDA. Use whenever the user asks about drug prescribing information — indications, warnings, dosage, adverse reactions, contraindications, or administration routes. Supports single or batch lookup by brand/generic name or by indication/conditio
| 1 | # openFDA Human Drug Skill |
| 2 | |
| 3 | Query structured SPL (Structured Product Labeling) data from the FDA. No API key needed (≤1 000 req/day). |
| 4 | |
| 5 | ## Input → Detection |
| 6 | |
| 7 | | Input Example | Routed To | |
| 8 | |---|---| |
| 9 | | `"ASPIRIN"` or `["METFORMIN","LISINOPRIL"]` | `search_drug` — brand/generic name lookup | |
| 10 | | `"hypertension"` or `["diabetes","migraine"]` | `search_by_indication` — indication text search | |
| 11 | | *(no input)* | `count_by_route` — top administration routes | |
| 12 | |
| 13 | All search functions accept **a single string or a list of strings**. |
| 14 | |
| 15 | ## API |
| 16 | |
| 17 | | Function | Input | Returns | |
| 18 | |---|---|---| |
| 19 | | `search_drug(query, limit)` | str \| list[str], int | `{term: [label_dicts]}` | |
| 20 | | `search_by_indication(query, limit)` | str \| list[str], int | `{condition: [label_dicts]}` | |
| 21 | | `count_by_route(top_n)` | int | `[{term, count}]` | |
| 22 | | `summarize(results)` | dict from above | compact multi-line text | |
| 23 | |
| 24 | Each `label_dict` contains: `brand_name`, `generic_name`, `manufacturer`, `route`, `substance_name`, `product_type`, `indications`, `contraindications`, `warnings`, `dosage`, `adverse_reactions`. |
| 25 | |
| 26 | ## Usage |
| 27 | |
| 28 | See `if __name__ == "__main__"` block in `05_openFDA_Human_Drug.py` for runnable examples covering: single drug, batch drugs, single indication, batch indications, route counts, and raw JSON output. |
| 29 | |
| 30 | ## Notes |
| 31 | |
| 32 | - Long text fields (`indications`, `warnings`, etc.) are truncated to keep payloads concise. |
| 33 | - On HTTP/query errors the result dict contains an `error` key for that term. |
| 34 | - Endpoint: `https://api.fda.gov/drug/label.json` |