| name | pubmed-agent |
| description | Query PubMed/NCBI biomedical literature using the pubmed-cli command-line tool. Use when the user needs to find, verify, or cite biomedical research — including searching for studies, fetching article details, generating citations, or verifying health claims with primary literature. Triggers include questions like "Find studies on berberine and E. coli", "Cite evidence for cold exposure and dopamine", "Is there RCT evidence for boron and SHBG?", "Get the abstract for PMID 29099763", or "Generate references for this health claim". |
pubmed-agent
Use the pubmed-cli binary to query PubMed/NCBI for biomedical literature. It uses the free NCBI E-utilities API (no browser needed). Results are cached for 1 year. Every result includes a Data from: timestamp — use --no-cache if the data is stale.
Commands
Search
pubmed-cli search "<query>" [--limit <n>] [--sort <method>] [--human-only] [--reviews-only] [--rct-only] [--since <year>] [--abstract]
--limit: max results, 1-100 (default 10)
--sort: relevance (default), date, cited
--human-only: filter to human studies (adds AND "humans"[MeSH])
--reviews-only: filter to review articles
--rct-only: filter to randomized controlled trials
--since <year>: only articles from this year onward
--abstract: include full abstracts (slower, uses efetch instead of esummary)
Output: Markdown list with title, authors, journal, year, PMID link, DOI link, article type.
Article details
pubmed-cli article <pmid> [pmid...] [--section <name>] [--cite <format>]
Accepts one or more numeric PMIDs.
--section options: overview, abstract, authors, mesh
--cite options: markdown, apa, bibtex — outputs a formatted citation instead of full details.
Output: Full Markdown with overview, abstract, authors with affiliations, MeSH terms.
Cite
pubmed-cli cite "<query>" [--limit <n>] [--format <fmt>] [--human-only] [--rct-only]
Search and return formatted citations ready to paste into documents.
--limit: number of citations (default 3)
--format: markdown (default), apa, bibtex
Global flags
--api-key <key>: NCBI API key (or set NCBI_API_KEY env var)
--email <addr>: contact email (or set NCBI_EMAIL env var)
--no-cache: bypass local cache
--json: output raw JSON instead of Markdown
Workflows
1. Find evidence for a specific health claim
pubmed-cli search "cold exposure dopamine receptor upregulation" --human-only --limit 5
pubmed-cli article 38901234 --section abstract
2. Generate a references section for a document
pubmed-cli cite "berberine antimicrobial gram-negative" --limit 3
pubmed-cli cite "boron SHBG testosterone" --limit 3 --human-only
The markdown citation format is ready to paste directly into a document.
3. Verify a supplement dosage claim
pubmed-cli search "boron 6mg SHBG reduction" --rct-only --human-only
pubmed-cli search "lithium orotate 5mg neuroprotection" --limit 5
4. Check safety / contraindications
pubmed-cli search "berberine CYP3A4 inhibition drug interaction" --reviews-only --limit 5
5. Find the latest research on a topic
pubmed-cli search "gut microbiome E.coli overgrowth treatment" --since 2023 --limit 10
6. Get full details with abstracts for deep review
pubmed-cli search "magnesium glycinate bioavailability" --abstract --limit 5
7. Compare multiple articles
pubmed-cli article 29099763 31520405 38901234
PubMed Query Syntax Tips
Use these modifiers in your search queries for precision:
"term"[ti] — search title only
"term"[tiab] — search title + abstract
"term"[MeSH] — search MeSH terms
AND "humans"[MeSH] — human studies only (or use --human-only)
AND "review"[pt] — review articles (or use --reviews-only)
AND "randomized controlled trial"[pt] — RCTs (or use --rct-only)
AND 2020:2026[dp] — date range (or use --since 2020)
"journal name"[journal] — specific journal
Tips
- Use specific search terms — "magnesium glycinate bioavailability" works better than "magnesium"
- Use
--human-only when looking for clinical evidence (filters out animal studies)
- Use
--rct-only when verifying treatment claims — RCTs are the gold standard
- Use
--reviews-only for broad topic overviews and systematic reviews
- The
cite command is the fastest way to generate a references section
- Use
article with multiple PMIDs to compare studies side by side
- The
--json flag is useful for programmatic processing
- Set
NCBI_EMAIL and optionally NCBI_API_KEY in your shell profile for convenience