PluginBench
Skill
Pass
Audit score 90

pubmed-database

affaan-m/everything-claude-code

Direct PubMed and NCBI E-utilities search for biomedical literature, MeSH queries, and citation retrieval.

What is pubmed-database?

This skill enables structured searches of PubMed and MEDLINE using NCBI E-utilities APIs. Use it when you need biomedical literature with precise field tags, MeSH terms, date filters, and publication-type constraints—especially for systematic reviews and repeatable search workflows.

  • Search PubMed with Boolean operators, field tags ([ti], [ab], [mh], [pt], [dp]), and MeSH subheadings
  • Look up PMIDs and retrieve abstracts, metadata, and full records via esearch, esummary, and efetch
  • Filter by publication type (clinical trial, meta-analysis, systematic review, guideline) and date ranges
  • Find related articles and linked resources using elink
  • Build repeatable search strings with proper logging for audit trails and reproducibility
  • Use NCBI history server for batch processing without URL length limits

How to install pubmed-database

npx skills add https://github.com/affaan-m/everything-claude-code --skill pubmed-database
Prerequisites
  • NCBI email address (required for API calls)
  • NCBI API key (optional but recommended for production; store in NCBI_API_KEY environment variable)
  • Python requests library or HTTP client for E-utilities calls
Claude Code
Cursor
Windsurf
Cline

How to use pubmed-database

  1. 1.Define your research question and break it into searchable concepts
  2. 2.Construct a PubMed query using field tags, MeSH terms, Boolean operators, and filters (date, publication type, language)
  3. 3.Call esearch.fcgi with your query to retrieve a list of PMIDs
  4. 4.Use esummary.fcgi to fetch lightweight metadata or efetch.fcgi for abstracts and full records
  5. 5.Log the exact search string, database, date, filters, and result count in a table or structured format
  6. 6.For large batches, use NCBI history server parameters (usehistory=y, WebEnv, query_key) instead of passing long PMID lists in URLs
  7. 7.Review the checklist: valid field tags, MeSH paired with free-text synonyms, explicit date ranges, error handling, and rate-limit respect

Use cases

Good for
  • Systematic review literature search with documented query strings and result counts
  • Researcher looking up specific PMIDs and retrieving abstracts in bulk
  • Building a literature monitoring pipeline that runs the same MeSH query monthly
  • Combining MeSH controlled vocabulary with free-text synonyms for emerging topics
  • Filtering randomized controlled trials on a specific disease published in the last 3 years
Who it's for
  • Biomedical researchers and systematic review authors
  • Literature review coordinators managing search reproducibility
  • Python or shell script developers building NCBI workflows
  • Clinical informaticists integrating PubMed into decision-support systems

pubmed-database FAQ

What is the difference between [mh] and [majr] MeSH tags?

[mh] matches any MeSH term in the article's indexing. [majr] matches only major MeSH topics, improving precision but potentially missing relevant work where the topic is secondary.

How do I combine MeSH terms with subheadings?

Put the subheading before the field tag: diabetes mellitus, type 2/drug therapy[mh] or cardiovascular diseases/prevention & control[mh].

Should I store my NCBI API key in code or environment variables?

Always store API keys in environment variables (e.g., NCBI_API_KEY), never in committed files or command history.

What is the NCBI history server and when should I use it?

The history server (usehistory=y, WebEnv, query_key) caches results on NCBI servers, allowing you to process large batches without passing very long PMID lists through URLs. Use it for systematic reviews with hundreds or thousands of results.

How do I handle rate limits when calling E-utilities?

Include a sleep delay (e.g., 0.35 seconds) between requests. Use an API key to increase your rate limit from 3 to 10 requests per second.

Full instructions (SKILL.md)

Source of truth, from affaan-m/everything-claude-code.


name: pubmed-database description: Direct PubMed and NCBI E-utilities search workflows for biomedical literature, MeSH queries, PMID lookup, citation retrieval, and API-backed literature monitoring. metadata: origin: community

PubMed Database

Use this skill when a task needs biomedical literature from PubMed rather than general web search.

When to Use

  • Searching MEDLINE or life-sciences literature.
  • Building PubMed queries with MeSH terms, field tags, dates, or article types.
  • Looking up PMIDs, abstracts, publication metadata, or related citations.
  • Running systematic-review search passes that need repeatable search strings.
  • Using NCBI E-utilities directly from Python, shell, or another HTTP client.

Query Construction

Start with the research question, split it into concepts, then combine concepts with Boolean operators.

concept_1 AND concept_2 AND filter
synonym_a OR synonym_b
NOT exclusion_term

Useful PubMed field tags:

  • [ti]: title
  • [ab]: abstract
  • [tiab]: title or abstract
  • [au]: author
  • [ta]: journal title abbreviation
  • [mh]: MeSH term
  • [majr]: major MeSH topic
  • [pt]: publication type
  • [dp]: date of publication
  • [la]: language

Examples:

diabetes mellitus[mh] AND treatment[tiab] AND systematic review[pt] AND 2023:2026[dp]
(metformin[nm] OR insulin[nm]) AND diabetes mellitus, type 2[mh] AND randomized controlled trial[pt]
smith ja[au] AND cancer[tiab] AND 2026[dp] AND english[la]

MeSH and Subheadings

Prefer MeSH when the concept has a stable controlled-vocabulary term. Combine MeSH with title/abstract terms when the topic is new or terminology varies.

Correct subheading syntax puts the subheading before the field tag:

diabetes mellitus, type 2/drug therapy[mh]
cardiovascular diseases/prevention & control[mh]

Use [majr] only when the topic must be central to the paper. It can improve precision but may miss relevant work.

Filters

Publication types:

  • clinical trial[pt]
  • meta-analysis[pt]
  • randomized controlled trial[pt]
  • review[pt]
  • systematic review[pt]
  • guideline[pt]

Date filters:

2026[dp]
2020:2026[dp]
2026/03/15[dp]

Availability filters:

free full text[sb]
hasabstract[text]

E-utilities Workflow

NCBI E-utilities supports repeatable API workflows:

  1. esearch.fcgi: search and return PMIDs.
  2. esummary.fcgi: return lightweight article metadata.
  3. efetch.fcgi: fetch abstracts or full records in XML, MEDLINE, or text.
  4. elink.fcgi: find related articles and linked resources.

Use an email and API key for production scripts. Store API keys in environment variables, never in committed files or command history.

import os
import time
import requests

BASE = "https://eutils.ncbi.nlm.nih.gov/entrez/eutils"


def esearch(query: str, retmax: int = 20) -> list[str]:
    params = {
        "db": "pubmed",
        "term": query,
        "retmode": "json",
        "retmax": retmax,
        "tool": "ecc-pubmed-search",
        "email": os.environ.get("NCBI_EMAIL", ""),
    }
    api_key = os.environ.get("NCBI_API_KEY")
    if api_key:
        params["api_key"] = api_key

    response = requests.get(f"{BASE}/esearch.fcgi", params=params, timeout=30)
    response.raise_for_status()
    time.sleep(0.35)
    return response.json()["esearchresult"]["idlist"]


pmids = esearch("hypertension[mh] AND randomized controlled trial[pt] AND 2024:2026[dp]")
print(pmids)

For batches, prefer NCBI history server parameters (usehistory=y, WebEnv, query_key) instead of passing very long PMID lists through URLs.

Output Discipline

For each search pass, record:

  • exact search string
  • database searched
  • date searched
  • filters used
  • result count
  • export format
  • any manual exclusions

Example:

| Database | Date searched | Query | Filters | Results |
| --- | --- | --- | --- | ---: |
| PubMed | 2026-05-11 | `sickle cell disease[mh] AND CRISPR[tiab]` | 2020:2026[dp], English | 42 |

Review Checklist

  • Are field tags valid PubMed tags?
  • Are MeSH terms paired with free-text synonyms for newer topics?
  • Is the date range explicit and appropriate?
  • Does the search log include enough detail to reproduce the query?
  • Are API keys loaded from the environment?
  • Does HTTP code call raise_for_status() or otherwise handle non-200 responses before parsing?
  • Are rate limits respected?

References