PluginBench
Skill
Review
Audit score 70

pubmed-database

affaan-m/ecc

Search PubMed and NCBI E-utilities for biomedical literature with MeSH queries, PMIDs, and citations.

What is pubmed-database?

This skill enables direct querying of PubMed and NCBI E-utilities for biomedical literature discovery. Use it when you need to construct complex searches with MeSH terms, field tags, date filters, and publication types, or when building reproducible systematic-review search workflows.

  • Construct and execute PubMed searches using MeSH terms, field tags, Boolean operators, and publication-type filters
  • Look up PMIDs, abstracts, and publication metadata via NCBI E-utilities API endpoints (esearch, esummary, efetch, elink)
  • Build repeatable search strings with explicit date ranges, language filters, and availability constraints
  • Retrieve related articles and linked resources using elink workflows
  • Log and document search parameters for systematic-review reproducibility

How to install pubmed-database

npx skills add null --skill pubmed-database
Prerequisites
  • NCBI email address (required for API requests)
  • NCBI API key (optional but recommended for production scripts; store in NCBI_API_KEY environment variable)
  • Python requests library or equivalent HTTP client for E-utilities calls
Claude Code
Cursor
Windsurf
Cline

How to use pubmed-database

  1. 1.Identify your research question and break it into searchable concepts (e.g., disease, intervention, outcome)
  2. 2.Construct a PubMed query using MeSH terms with [mh] tags, free-text terms with [tiab], and filters like publication type [pt] and date range [dp]
  3. 3.Use the provided esearch() Python function or call the E-utilities API directly with your query string
  4. 4.Retrieve PMID results and optionally fetch full metadata using esummary or efetch endpoints
  5. 5.Document your search string, filters, date searched, and result count in a reproducible log or table

Use cases

Good for
  • Searching MEDLINE for literature on a specific disease and treatment combination with date and study-type filters
  • Building a systematic-review search protocol with multiple concept combinations and recording exact query strings for reproducibility
  • Looking up article metadata and abstracts for a list of PMIDs using batch API calls
  • Finding related articles and citations for a known paper using elink
  • Monitoring new publications on a topic by running the same query periodically and tracking result counts
Who it's for
  • Biomedical researchers and clinicians conducting literature reviews
  • Systematic-review authors building and documenting search strategies
  • Bioinformaticians integrating PubMed queries into data pipelines
  • Students and academics searching life-sciences literature

pubmed-database FAQ

What is the difference between MeSH terms and free-text search?

MeSH terms are controlled vocabulary from the Medical Subject Headings thesaurus and provide precise indexing; free-text search matches keywords in title and abstract. Use MeSH for established concepts and combine with free-text for newer or variable terminology.

How do I filter results to only randomized controlled trials published in the last 3 years?

Use the query: `your_topic[tiab] AND randomized controlled trial[pt] AND 2023:2026[dp]`. Replace your_topic with your search term, [pt] specifies publication type, and [dp] sets the date range.

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

The history server (usehistory=y parameter) stores large result sets on NCBI servers and returns a WebEnv token and query_key, allowing you to reference results across multiple API calls without passing long PMID lists in URLs. Use it for batch workflows with hundreds or thousands of results.

How do I avoid hitting NCBI rate limits?

Include a 0.35-second delay between requests (or longer without an API key), use an API key to increase your rate limit, and batch requests using the history server when possible.

Can I export search results for use in reference management software?

Yes. Use efetch with rettype=medline for MEDLINE format or rettype=xml for XML; both formats are compatible with Zotero, Mendeley, and other reference managers.

Full instructions (SKILL.md)

Source of truth, from affaan-m/ecc.


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