tooluniverse-pharmacovigilance
Pharmacovigilance Safety Analyzer
Systematic drug safety analysis using FAERS adverse event data, FDA labeling, PharmGKB pharmacogenomics, and clinical trial safety signals.
KEY PRINCIPLES:
- Report-first approach - Create report file FIRST, update progressively
- Signal quantification - Use disproportionality measures (PRR, ROR)
- Severity stratification - Prioritize serious/fatal events
- Multi-source triangulation - FAERS, labels, trials, literature
- Pharmacogenomic context - Include genetic risk factors
- Actionable output - Risk-benefit summary with recommendations
- English-first queries - Always use English drug names in tool calls
When to Use
Apply when user asks:
- "What are the safety concerns for [drug]?"
- "What adverse events are associated with [drug]?"
- "Is [drug] safe? What are the risks?"
- "Compare safety profiles of [drug A] vs [drug B]"
- "Pharmacovigilance analysis for [drug]"
Critical Workflow Requirements
Report-First Approach (MANDATORY)
- Create
[DRUG]_safety_report.mdFIRST with all section headers and[Researching...]placeholders - Progressively update as data is gathered
- Output separate data files:
[DRUG]_adverse_events.csvand[DRUG]_pharmacogenomics.csv
Citation Requirements (MANDATORY)
Every safety signal MUST include source tool, data period, PRR, case counts, and serious/fatal breakdown.
Tool Parameter Reference (CRITICAL)
| Tool | WRONG Parameter | CORRECT Parameter |
|---|---|---|
FAERS_count_reactions_by_drug_event |
drug |
drug_name |
DailyMed_search_spls |
name |
drug_name |
PharmGKB_search_drug |
drug |
query |
OpenFDA_get_drug_events |
drug_name |
search |
Workflow Overview
Phase 1: Drug Disambiguation
-> Resolve drug name, get identifiers (ChEMBL, DrugBank)
Phase 2: Adverse Event Profiling (FAERS)
-> Query FAERS, calculate PRR, stratify by seriousness
Phase 3: Label Warning Extraction
-> DailyMed boxed warnings, contraindications, precautions
Phase 4: Pharmacogenomic Risk
-> PharmGKB clinical annotations, high-risk genotypes
Phase 5: Clinical Trial Safety
-> ClinicalTrials.gov Phase 3/4 safety data
Phase 5.5: Pathway & Mechanism Context
-> KEGG drug metabolism, target pathway analysis
Phase 5.6: Literature Intelligence
-> PubMed, BioRxiv/MedRxiv, OpenAlex citation analysis
Phase 6: Signal Prioritization
-> Rank by PRR x severity x frequency
Phase 7: Report Synthesis
Phase 1: Drug Disambiguation
- Search DailyMed via
DailyMed_search_spls(drug_name=...)for NDC, SPL setid, generic name - Search ChEMBL via
ChEMBL_search_drugs(query=...)for molecule ID, max phase - Document: generic name, brand names, drug class, mechanism, approval date
Phase 2: Adverse Event Profiling (FAERS)
- Query
FAERS_count_reactions_by_drug_event(drug_name=..., limit=50)for top events - For each event, get detailed breakdown (serious, fatal, hospitalization counts)
- Calculate PRR:
(A/B) / (C/D)where A=drug+event, B=drug+any, C=event+any_other, D=total_other - Apply signal thresholds: PRR > 2.0 (signal), > 3.0 (strong signal), case count >= 3
Severity classification:
- Fatal (highest priority), Life-threatening, Hospitalization, Disability, Other serious, Non-serious
See SIGNAL_DETECTION.md for detailed disproportionality formulas and example output tables.
Phase 3: Label Warning Extraction
- Get label via
DailyMed_get_spl_by_set_id(setid=...) - Extract: boxed warnings, contraindications, warnings/precautions, drug interactions
- Categorize severity: Boxed Warning > Contraindication > Warning > Precaution
Phase 4: Pharmacogenomic Risk
- Search
PharmGKB_search_drug(query=...)for clinical annotations - Document actionable variants with evidence levels (1A/1B/2A/2B/3)
- Note CPIC/DPWG guideline status
PGx Evidence Levels:
| Level | Description | Action |
|---|---|---|
| 1A | CPIC/DPWG guideline, implementable | Follow guideline |
| 1B | CPIC/DPWG guideline, annotation | Consider testing |
| 2A | VIP annotation, moderate evidence | May inform |
| 2B | VIP annotation, weaker evidence | Research |
| 3 | Low-level annotation | Not actionable |
Phase 5: Clinical Trial Safety
- Search
search_clinical_trials(intervention=..., phase="Phase 3", status="Completed") - Extract serious AE rates, discontinuation rates, deaths
- Compare drug vs placebo rates
Phase 5.5: Pathway & Mechanism Context
- Query KEGG for drug metabolism pathways
- Analyze target pathways for mechanistic basis of AEs
- Document pathway-AE relationships
Phase 5.6: Literature Intelligence
- PubMed:
PubMed_search_articles(query='"[drug]" AND (safety OR adverse OR toxicity)') - BioRxiv/MedRxiv: Search for recent preprints (flag as not peer-reviewed)
- OpenAlex: Citation analysis for key safety papers
Phase 6: Signal Prioritization
Signal Score = PRR x Severity_Weight x log10(Case_Count + 1)
Severity weights: Fatal=10, Life-threatening=8, Hospitalization=5, Disability=5, Other serious=3, Non-serious=1
Categorize signals:
- Critical (immediate attention): High PRR + fatal outcomes
- Moderate (monitor): Moderate PRR + serious outcomes
- Known/Expected (manage clinically): Low PRR, in label
Output Report
Save as [DRUG]_safety_report.md. See REPORT_TEMPLATES.md for the full report structure and example outputs.
Evidence Grading
| Tier | Criteria | Example |
|---|---|---|
| T1 | PRR >10, fatal outcomes, boxed warning | Lactic acidosis |
| T2 | PRR 3-10, serious outcomes | Hepatotoxicity |
| T3 | PRR 2-3, moderate concern | Hypoglycemia |
| T4 | PRR <2, known/expected | GI side effects |
Fallback Chains
| Primary Tool | Fallback 1 | Fallback 2 |
|---|---|---|
FAERS_count_reactions_by_drug_event |
OpenFDA_get_drug_events |
Literature search |
DailyMed_get_spl_by_set_id |
FDA_drug_label_search |
DailyMed website |
PharmGKB_search_drug |
CPIC_get_guidelines |
Literature search |
search_clinical_trials |
ClinicalTrials.gov API |
PubMed for trial results |
Completeness Checklist
See CHECKLIST.md for the full phase-by-phase verification checklist.
References
- FAERS: https://www.fda.gov/drugs/questions-and-answers-fdas-adverse-event-reporting-system-faers
- DailyMed: https://dailymed.nlm.nih.gov
- PharmGKB: https://www.pharmgkb.org
- ClinicalTrials.gov: https://clinicaltrials.gov
- OpenFDA: https://open.fda.gov
- KEGG Drug: https://www.genome.jp/kegg/drug
- Tool documentation: TOOLS_REFERENCE.md