$npx -y skills add QSong-github/DrugClaw --skill mecddiQuery the MecDDI mechanism-based drug-drug interaction database. Use whenever the user asks about drug-drug interactions, DDI mechanisms (PK/PD), enzyme or transporter-mediated interactions, or wants to look up interacting drug pairs by drug name or MecDDI drug ID. Trigger on key
| 1 | # MecDDI Query Skill |
| 2 | |
| 3 | Search MecDDI drug-drug interaction records by drug name or drug ID. Auto-detects input type: |
| 4 | |
| 5 | | Input Pattern | Detected As | Match Logic | |
| 6 | |---|---|---| |
| 7 | | `D0123` | MecDDI Drug ID | exact on `A_Drug_ID` / `B_Drug_ID` | |
| 8 | | anything else | free text | substring on `A_Drug_Name` / `B_Drug_Name` | |
| 9 | |
| 10 | ## Mechanism Categories (7 files) |
| 11 | |
| 12 | | Category | Type | |
| 13 | |---|---| |
| 14 | | Affected Gastrointestinal Absorption | PK | |
| 15 | | Affected Cellular Transport | PK | |
| 16 | | Affected Organization Distribution | PK | |
| 17 | | Affected Intra/Extra-Hepatic Metabolism | PK | |
| 18 | | Affected Excretion Pathways | PK | |
| 19 | | Pharmacodynamic Additive Effects | PD | |
| 20 | | Pharmacodynamic Antagonistic Effects | PD | |
| 21 | |
| 22 | ## API |
| 23 | |
| 24 | | Function | Input | Returns | |
| 25 | |---|---|---| |
| 26 | | `load_mecddi(data_dir)` | directory path | list[dict] (all records) | |
| 27 | | `search(records, entity)` | single entity string | list[dict] | |
| 28 | | `search_batch(records, entities)` | list of strings | dict[str, list[dict]] | |
| 29 | | `summarize(hits, entity)` | hits + label | compact text for LLM | |
| 30 | | `to_json(hits)` | list[dict] | JSON string | |
| 31 | |
| 32 | ## Data |
| 33 | |
| 34 | - **Source**: 7 TSV files downloaded from <https://mecddi.idrblab.net/download> |
| 35 | - **Path**: `DATA_DIR` variable in `19_MecDDI.py` (default: `resources_metadata/ddi/MecDDI`) |
| 36 | - **Columns**: `A_Drug_ID`, `A_Drug_Name`, `B_Drug_ID`, `B_Drug_Name`, `Mechanism_Category` |
| 37 | |
| 38 | ## Usage |
| 39 | |
| 40 | See `if __name__ == "__main__"` block in `19_MecDDI.py` for runnable examples covering: |
| 41 | |
| 42 | 1. **Single drug name** → `search(data, "Atropine")` |
| 43 | 2. **Single drug ID** → `search(data, "D0123")` |
| 44 | 3. **Batch query** → `search_batch(data, ["Meclizine", "Isocarboxazid", "D0853"])` |
| 45 | 4. **JSON output** → `to_json(hits)` |
| 46 | 5. **LLM-friendly summary** → `summarize(hits, entity)` |