Skip to content
Back to skills

Drugmechdb

ASecurity

Query the DrugMechDB drug mechanism-of-action database. Use whenever the user asks about drug mechanisms, drug-to-disease paths, biological targets of a drug, or wants to look up any biomedical entity (drug name, protein, disease, DrugBank ID, MESH ID, UniProt ID, GO term, etc.) in DrugMechDB.

  • 230 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added September 6, 2026
ai-agentspythongoreactnodeexpressapidatabase

Works with

  • api

Security analysis

A100/100

Pro scans all 6 files and shows the line behind each finding

Scanned September 6, 2026

npx -y skills add BioTender-max/awesome-bio-agent-skills --skill drugmechdb --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Drugmechdb?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Drugmechdb
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/biotender-max-drugmechdb/badge)](https://www.skillsdirectory.com/skills/biotender-max-drugmechdb)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: drugmechdb-query
description: >
  Query the DrugMechDB drug mechanism-of-action database. Use whenever the user
  asks about drug mechanisms, drug-to-disease paths, biological targets of a drug,
  or wants to look up any biomedical entity (drug name, protein, disease, DrugBank ID,
  MESH ID, UniProt ID, GO term, etc.) in DrugMechDB.
---

# DrugMechDB Query Skill

Search drug mechanism-of-action paths by entity name or ID. Each path is a directed graph: Drug → (intermediates) → Disease, with typed nodes and labeled edges.

## Data

- **Source**: `indication_paths.json`
- **Path**: `resources_metadata/drug_mechanism/DRUGMECHDB/indication_paths.json`
- **Records**: ~4846 mechanism paths, ~32k relationships

## Entity auto-detection

| Input pattern | Detected as | Example |
|---|---|---|
| `DB:DB00619` | DrugBank ID | exact on node/graph IDs |
| `MESH:D015464` | MESH ID | exact on node/graph IDs |
| `UniProt:P00519` | UniProt protein | exact on node IDs |
| `GO:0006915` | GO term | exact on node IDs |
| `CHEBI:*`, `HP:*`, `UBERON:*`, `CL:*`, `reactome:*`, `InterPro:*`, `PR:*`, `taxonomy:*` | respective types | exact on node IDs |
| anything else | free text | substring match on drug/disease/node names |

## API

| Function | Signature | Returns |
|---|---|---|
| `load(path)` | path to JSON | `list[dict]` — full database |
| `build_index(db)` | loaded db | `(by_id, by_name, by_drug, by_disease)` dicts for O(1) lookup |
| `search(db, entity, index=None)` | single query string | `list[dict]` — matching paths |
| `search_batch(db, entities, index=None)` | list of query strings | `dict[str, list[dict]]` |
| `summarize(paths, entity)` | search results | compact multi-line text |
| `to_json(paths)` | search results | list of flat dicts (id, drug, disease, nodes, links) |

## Node types (14)

BiologicalProcess, Cell, CellularComponent, ChemicalSubstance, Disease, Drug, GeneFamily, GrossAnatomicalStructure, MacromolecularComplex, MolecularActivity, OrganismTaxon, Pathway, PhenotypicFeature, Protein

## Quick usage

```python
import drugmechdb_query as dq

db = dq.load()  # uses default DATA_PATH
idx = dq.build_index(db)  # optional, recommended for repeated queries

# Single query — by name or ID
paths = dq.search(db, "imatinib", idx)
paths = dq.search(db, "UniProt:P00519", idx)
paths = dq.search(db, "MESH:D003920", idx)
print(dq.summarize(paths, "imatinib"))

# Batch query
results = dq.search_batch(db, ["metformin", "MESH:D003920", "asthma"], idx)
for entity, paths in results.items():
    print(dq.summarize(paths, entity))

# JSON export
print(dq.to_json(paths))
```

## Output structure per path

```
graph:  { _id, drug, disease, drugbank, drug_mesh, disease_mesh }
nodes:  [{ id, label, name }, ...]
links:  [{ source, target, key }, ...]
```

`key` examples: `decreases activity of`, `causes`, `positively regulates`, `treats`, `increases expression of`, etc. (66 relation types total).

Files in this skill

  • README.md1.2 KB
  • SKILL.md2.9 KB
  • __init__.py146 B
  • drugmechdb_skill.py6 KB
  • example.py7.2 KB
  • retrieve.py881 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.