PubMed Abstract Reader
Instructions
This skill retrieves detailed PubMed article information via the NCBI E-utilities API, including title, authors, journal, year, abstract, and publication types.
Features
- Batch Abstract Retrieval by PMID — Provide a set of PMIDs and receive complete metadata and abstracts for each article.
- Keyword Search — Enter search terms (supporting Boolean operators) and receive a list of matching articles, with optional time-window filtering.
Usage
# Retrieve by PMID (comma-separated)
python3 pubmed_abstract.py 33012899,29625055,28228467
# Run default search example (EGFR L858R osimertinib) when no arguments are provided
python3 pubmed_abstract.py
Environment Variables (Optional)
NCBI_API_KEY— NCBI API Key; when configured, the rate limit increases from 3 requests/sec to 10 requests/sec.NCBI_EMAIL— Contact email; NCBI recommends providing one so they can reach you if issues arise.
Output Format
Each article returns the following fields:
| Field | Description |
|-------|-------------|
| pmid | PubMed ID |
| title | Article title |
| authors | Author list |
| journal | Journal name |
| year | Publication year |
| abstract | Full abstract text |
| publication_types | List of publication types (e.g., Journal Article, Review, etc.) |
Agent Guidelines
Use this skill when the user provides PMIDs or needs to retrieve PubMed article abstracts:
- Run
python3 pubmed_abstract.py <pmid1>,<pmid2>,...to fetch article information. - Present the returned JSON results to the user, highlighting the title, authors, journal, year, and abstract.
- If the user provides keywords instead of PMIDs, call the
search_pubmed()method within the script to perform a search. - Respect NCBI rate limits: no more than 3 requests/sec without an API key, and no more than 10 requests/sec with an API key.