Catalog
affaan-m/pubmed-database

affaan-m

pubmed-database

Direct PubMed and NCBI E-utilities search workflows for biomedical literature, MeSH queries, PMID lookup, citation retrieval, and API-backed literature monitoring.

New~1.2kUpdated Jul 14, 2026

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

Files1
1 files · 1.0 KB

Select a file to preview

Overall Score

87/100

Grade

A

Excellent

Safety

88

Quality

88

Clarity

87

Completeness

84

Summary

A PubMed and NCBI E-utilities search skill for biomedical literature discovery. Provides guidance on query construction, MeSH terminology, publication filters, and Python-based API workflows for reproducible literature searches and systematic review protocols.

Detected Capabilities

HTTP request to NCBI E-utilities APIEnvironment variable read for API credentialsJSON parsing of API responsesPython code generation for search workflowsQuery string construction with field tags and filters

Trigger Keywords

Phrases that MCP clients use to match this skill to user intent.

pubmed searchliterature reviewmesh querymedline databasesystematic review searchncbi apipmid lookupcitation retrieval

Risk Signals

INFO

HTTP requests to NCBI E-utilities (eutils.ncbi.nlm.nih.gov)

Section: E-utilities Workflow, code example
INFO

Environment variable read for NCBI_API_KEY and NCBI_EMAIL

Code example: esearch function
INFO

Rate-limiting guidance provided (time.sleep 0.35s, respect rate limits)

Section: E-utilities Workflow and Review Checklist

Referenced Domains

External domains referenced in skill content, detected by static analysis.

eutils.ncbi.nlm.nih.govpubmed.ncbi.nlm.nih.govsupport.nlm.nih.govwww.ncbi.nlm.nih.gov

Use Cases

  • Searching MEDLINE and life-sciences literature with advanced query syntax
  • Building MeSH-term and field-tagged PubMed queries
  • Retrieving article metadata and abstracts via PMID lookup
  • Constructing repeatable search strings for systematic reviews
  • Automating E-utilities API calls with Python for batch literature retrieval
  • Filtering results by publication type, date, and availability
  • Documenting search methodology for reproducible research

Quality Notes

  • ✓ Clear use-case boundaries: biomedical literature only, not general web search
  • ✓ Comprehensive field tag reference with examples for each PubMed search modifier
  • ✓ Multiple real-world query examples covering different research scenarios
  • ✓ Explicit security guidance: API keys via environment variables, never hardcoded
  • ✓ Error handling pattern documented: raise_for_status() before parsing
  • ✓ Rate-limit guidance included both in code (0.35s sleep) and checklist
  • ✓ Output discipline section ensures reproducibility with logging template
  • ✓ Well-organized structure with sections for query construction, filters, API workflow
  • ✓ References to official NCBI documentation provided
  • ✓ Subheading syntax example clarifies correct MeSH usage
Model: claude-haiku-4-5-20251001Analyzed: Jul 14, 2026

Reviews

Add this skill to your library to leave a review.

No reviews yet

Be the first to share your experience.

Version History

  1. v1.1

    Content updated

    ✦ AINo behavioral changes detected.

    2026-07-14

    Latest
  2. v1.0

    2026-05-15

    View This VersionInitial version

Use affaan-m/pubmed-database in your dev environment

Command Palette

Search for a command to run...