Pharmaclaw Market Intel Agent

Fetches and analyzes FAERS (FDA Adverse Event Reporting System) data from openFDA API. Supports drug names and SMILES (resolves via PubChem). Generates: even...

MIT-0 · Free to use, modify, and redistribute. No attribution required.
0 · 146 · 1 current installs · 1 all-time installs
MIT-0
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
high confidence
Purpose & Capability
Name/description (FAERS, PubChem SMILES resolution, ClinicalTrials.gov) match the included scripts (query_faers.py, query_trials.py, chain_entry.py). The workflows, output files, and APIs used align with the claimed functionality.
Instruction Scope
SKILL.md directs the agent to run the provided scripts which only query public APIs (openFDA, PubChem, ClinicalTrials.gov), generate JSON summaries and plots, and write outputs to an output directory. The instructions do not request unrelated files, credentials, or system-wide state.
Install Mechanism
This is instruction-only (no install spec) but includes Python scripts that import third-party packages (requests, pandas, matplotlib). The skill does not declare these dependencies or provide an install step; runtime failures are likely unless the environment already provides them. No risky remote installers or unknown download URLs are present.
Credentials
The skill declares no required environment variables, credentials, or config paths. The external network access it performs (public APIs) is proportionate to its purpose. There are no requests for unrelated secrets or credentials.
Persistence & Privilege
always is false and the skill does not request persistent system privileges. It writes outputs into user-specified output directories but does not modify other skills or system configuration.
Assessment
This skill appears to do what it says: query public drug safety and clinical trial APIs, resolve SMILES via PubChem, and produce JSON and PNG outputs. Before installing: (1) ensure your runtime has the required Python packages (requests, pandas, matplotlib) or run it in a Python environment that provides them; (2) be aware the scripts make outbound HTTP requests to public APIs (open.fda.gov, pubchem.ncbi.nlm.nih.gov, clinicaltrials.gov) and will write files to the output directory; (3) review the included scripts locally if you want to confirm no additional network endpoints or behaviors are added; and (4) note there is no homepage or source repository listed—if provenance is important, ask the publisher for a code repository or license before using in sensitive environments.

Like a lobster shell, security has layers — review code before you run it.

Current versionv1.0.0
Download zip
latestvk977qpdaq43w0fyt5w3jx0kx0x82ps79

License

MIT-0
Free to use, modify, and redistribute. No attribution required.

SKILL.md

Pharma Market Intel Agent - FAERS Query Skill

Overview

Query real-world post-market safety data for drugs. Useful for market intel on safety profiles, emerging risks, competitor analysis.

Key outputs:

  • JSON summaries (trends, top reactions/outcomes)
  • PNG bar charts (yearly reports, top 10 reactions/outcomes)
  • Sample recent events

Rate limits: openFDA ~240 req/min. Counts are fast (no full data).

Chemistry-Query Structure

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\"]
}

Quick Start / Workflows

1. Basic Query (All Metrics)

exec skills/pharma-market-intel-agent/scripts/query_faers.py --drug aspirin --output ./aspirin_faers

Generates:

  • aspirin_faers/aspirin_summary.json
  • *.png plots
  • Recent events JSON

2. SMILES Input

exec ... --drug \"CC(=O)OC1=CC=CC=C1C(=O)O\"  # Aspirin SMILES

Auto-resolves to name via PubChem.

3. Custom Limit

exec ... --drug ozempic --limit-events 50 --output ozempic_analysis

Chaining Examples

  • With chemistry-query: Resolve/validate SMILES first, then FAERS.
  • pharma-tox-agent: Feed top reactions for tox prediction.
  • pharma-ip-expansion-agent: Check safety for IP expansion targets.
  • traction-agent: Market risk scoring from FAERS trends.
# 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

ClinicalTrials.gov Integration

Query clinical trial data from ClinicalTrials.gov API v2. Search by drug, condition, phase, and status. No API key needed.

Quick Start

# 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

Outputs

  • {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

JSON Summary Structure

{
  "drug": "sotorasib",
  "total_found": 45,
  "trials": [{"nct_id": "NCT...", "title": "...", "phase": "PHASE3", "sponsor": "Amgen", ...}],
  "stats": {"by_phase": {...}, "by_status": {...}, "top_sponsors": [...], "top_conditions": [...]}
}

Chaining Examples

  • Chemistry Query → Market Intel: Resolve SMILES, then query trials for competitive landscape
  • FAERS + Trials: Run both scripts for a drug to get safety profile + development pipeline
  • chain_entry.py: Use --metrics trials or --metrics faers,trials to run both in one call

References

Resources

  • scripts/query_faers.py: FAERS query executable
  • scripts/query_trials.py: ClinicalTrials.gov query executable
  • scripts/chain_entry.py: Unified entry point (faers + trials)
  • assets/: Store generated PNGs here for reuse

Files

10 total
Select a file
Select a file to preview.

Comments

Loading comments…