Install
openclaw skills install pharmaclaw-market-intel-agentFetches and analyzes FAERS (FDA Adverse Event Reporting System) data from openFDA API. Supports drug names and SMILES (resolves via PubChem). Generates: even...
openclaw skills install pharmaclaw-market-intel-agentQuery real-world post-market safety data for drugs. Useful for market intel on safety profiles, emerging risks, competitor analysis.
Key outputs:
Rate limits: openFDA ~240 req/min. Counts are fast (no full data).
Parse user queries into this model for standardized chaining:
from dataclasses import dataclass
from typing import List, Optional
@dataclass
class ChemistryQuery:
drug: str # Drug name or SMILES
query_type: str = 'faers' # 'faers', 'pubchem', etc.
metrics: Optional[List[str]] = None # ['yearly_trends', 'top_reactions', 'top_outcomes', 'events']
limit_events: int = 20
Example:
{
\"drug\": \"aspirin\", // or \"CC(=O)OC1=CC=CC=C1C(=O)O\"
\"query_type\": \"faers\",
\"metrics\": [\"yearly_trends\", \"top_reactions\"]
}
exec skills/pharma-market-intel-agent/scripts/query_faers.py --drug aspirin --output ./aspirin_faers
Generates:
exec ... --drug \"CC(=O)OC1=CC=CC=C1C(=O)O\" # Aspirin SMILES
Auto-resolves to name via PubChem.
exec ... --drug ozempic --limit-events 50 --output ozempic_analysis
# Agent workflow:
1. Parse ChemistryQuery
2. Resolve SMILES if needed (pubchempy or query_faers handles)
3. Run query_faers.py
4. Read PNGs/JSONs into response
5. Chain if metrics require
Query clinical trial data from ClinicalTrials.gov API v2. Search by drug, condition, phase, and status. No API key needed.
# Search by drug
exec skills/pharma-market-intel-agent/scripts/query_trials.py --drug "sotorasib" --output ./sotorasib_trials
# Search by condition + filters
exec ... --condition "breast cancer" --phase PHASE3 --status RECRUITING --limit 10 --output ./bc_trials
# Search by both
exec ... --drug "pembrolizumab" --condition "NSCLC" --output ./pembro_trials
# SMILES input (auto-resolves via PubChem)
exec ... --drug "CC(=O)OC1=CC=CC=C1C(=O)O" --output ./aspirin_trials
{drug}_trials_summary.json — Full structured summary with trials list and aggregate stats{drug}_trials_by_phase.png — Bar chart by phase{drug}_trials_by_status.png — Bar chart by status{drug}_trials_timeline.png — Timeline of trial start dates{
"drug": "sotorasib",
"total_found": 45,
"trials": [{"nct_id": "NCT...", "title": "...", "phase": "PHASE3", "sponsor": "Amgen", ...}],
"stats": {"by_phase": {...}, "by_status": {...}, "top_sponsors": [...], "top_conditions": [...]}
}
--metrics trials or --metrics faers,trials to run both in one call