$npx -y skills add QSong-github/DrugClaw --skill ndfrtQuery NDF-RT (National Drug File Reference Terminology) via the NCI EVS REST API. Use when looking up drug mechanisms of action, physiological effects, pharmacologic classes, chemical structures, or drug–disease relationships (may_treat / may_prevent) in NDF-RT. Accepts drug name
| 1 | # NDF-RT Query Skill |
| 2 | |
| 3 | Search NDF-RT concepts by drug name or NDF-RT code via the NCI EVS REST API. |
| 4 | Auto-detects entity type by pattern: |
| 5 | |
| 6 | | Input Pattern | Detected As | Lookup Logic | |
| 7 | |---|---|---| |
| 8 | | `N0000145918` | NDF-RT code (`N` + 10 digits) | direct concept GET | |
| 9 | | anything else | free text | full-text search endpoint | |
| 10 | |
| 11 | ## API |
| 12 | |
| 13 | | Function | Input | Returns | |
| 14 | |---|---|---| |
| 15 | | `search(entity, limit)` | single entity string | `dict` with `entity`, `type`, `results` | |
| 16 | | `search_batch(entities, limit)` | list of entity strings | `dict[str, dict]` | |
| 17 | | `summarize(result, entity)` | search result dict + label | compact multi-line text | |
| 18 | | `to_json(result)` | search result dict | `list[dict]` | |
| 19 | |
| 20 | ### Result dict structure |
| 21 | |
| 22 | Each item in `results` contains: |
| 23 | |
| 24 | | Key | Description | |
| 25 | |---|---| |
| 26 | | `code` | NDF-RT concept code | |
| 27 | | `name` | Preferred concept name | |
| 28 | | `kind` | Concept kind (e.g. `DRUG_KIND`, `DISEASE_KIND`) | |
| 29 | | `properties` | flat `{type: value}` property dict | |
| 30 | | `roles` | list of `{type, relatedCode, relatedName}` role relationships | |
| 31 | | `parents` | list of `{code, name}` ISA parent concepts | |
| 32 | | `synonyms` | deduplicated list of synonym strings | |
| 33 | |
| 34 | ### Key NDF-RT relationship types (roles) |
| 35 | |
| 36 | | Role | Meaning | |
| 37 | |---|---| |
| 38 | | `has_MoA` | mechanism of action | |
| 39 | | `has_PE` | physiological effect | |
| 40 | | `has_EPC` | established pharmacologic class | |
| 41 | | `may_treat` | indicated disease/condition | |
| 42 | | `may_prevent` | preventable disease/condition | |
| 43 | | `CI_with` | contraindicated with | |
| 44 | | `has_Chemical_Structure` | chemical structure classification | |
| 45 | |
| 46 | ## Usage |
| 47 | |
| 48 | See `if __name__ == "__main__"` block in `52_NDF_RT.py` for runnable examples |
| 49 | covering: drug name search, code lookup, batch search, JSON output, and root |
| 50 | concept listing. |
| 51 | |
| 52 | ## Data |
| 53 | |
| 54 | - **Source**: NCI EVS REST API (`https://api-evsrest.nci.nih.gov/api/v1`) |
| 55 | - **Terminology**: `ndfrt` |
| 56 | - **Auth**: none required |
| 57 | - **Rate limits**: not documented; use reasonable request spacing |
| 58 | - **Maintainer**: U.S. Department of Veterans Affairs / NCI Enterprise Vocabulary Services |