pubmed-guide
Skill171 starsChanged 38 days agoApache-2.0View on GitHub
PubMed query syntax, identifier crosswalks, and gates for the pubmed_* tools over PubMed, PubMed Central, Europe PMC, and NIH iCite. Use when building a MeSH-based or systematic search, resolving a reference list or DOIs to PMIDs, judging how cited an article is, getting full text, or finding preprints and records PubMed lacks.
- Reads credentials
The file
Files
Scope
Biomedical literature: PubMed records (MEDLINE, PubMed Central, NCBI Bookshelf), PMC full text, Europe PMC (adds preprints, patents, Agricola), and NIH iCite citation metrics. Keyless. NCBI_API_KEY raises NCBI's rate ceiling, UNPAYWALL_EMAIL adds an Unpaywall full-text tier, and a deployment that sets EUROPEPMC_ENABLED=false registers neither Europe PMC tool.
- Full text only where an open copy exists: PMC, Europe PMC's open-access subset, or, with
UNPAYWALL_EMAILset, a copy Unpaywall finds. A subscription article outside all three comes back inunavailable. - iCite metrics are keyed by PMID, so a work PubMed doesn't index has none here.
- Trial registrations appear only as accessions in
pubmed_fetch_articlesdataBanks; the registry record itself is a ClinicalTrials.gov server's job. Literature outside biomedicine belongs to an OpenAlex or Crossref server.
Identifiers
| ID | Form | Comes from |
| PMID | digits | pubmed_search_articles, pubmed_lookup_citation, a MED hit of pubmed_europepmc_search (its epmcId is the PMID) |
| PMCID | PMC + digits | pmcId on pubmed_fetch_articles records, search summaries, and pubmed_find_related rows; pubmed_convert_ids |
| DOI | 10.…/…; pubmed_convert_ids and pubmed_fetch_fulltext also read its https://doi.org/… link or doi: form as the bare DOI | doi on pubmed_fetch_articles records, search summaries, pubmed_find_related rows, and Europe PMC hits |
Europe PMC source + epmcId | PPR1306463 | pubmed_europepmc_search hits only; preprints and patents often carry no PMID or DOI |
| MeSH record | descriptor name, or the clause in searchTerm | name and searchTerm on pubmed_lookup_mesh results |
| ORCID | 0000-0002-5446-9969 | orcid on pubmed_fetch_articles authors, when the record carries one |
Crosswalks:
- PMID → DOI or PMCID:
pubmed_fetch_articles, for any PubMed record. It takes PMIDs only: a PMC ID or DOI there is rejected with a pointer topubmed_convert_idsorpubmed_fetch_fulltext. - DOI → PMID:
pubmed_convert_idstakes the bare DOI, itshttps://doi.org/…link, or thedoi:form, and answers only for articles in PMC;10.1056/NEJMoa1911303(not in PMC) fails there. Search10.1056/NEJMoa1911303[doi]withpubmed_search_articles(returns 31535829), orDOI:"10.1056/NEJMoa1911303"withpubmed_europepmc_search, whose hit carries the PMID. - ORCID → an author's papers:
0000-0002-5446-9969[auid]inpubmed_search_articlesreturned 46 records. It matches only records whose author entry carries that ORCID, however the name is spelled.
Gates
Building a PubMed search
| Syntax | Matches |
term[tiab], term[ti] | title and abstract words; title only |
"a b"[tiab:~3] | both words within 3 of each other |
"Name"[mh], [mh:noexp], [majr] | MeSH heading plus every narrower heading; the heading alone; as a major topic |
"Name"[pa] | records indexed with any substance that has that pharmacological action |
"Name"[nm] | records indexed with that supplementary concept (a drug or chemical with no descriptor; a chemicals entry on pubmed_fetch_articles with a C UI); no [mh] clause matches one |
"Heading/qualifier"[mh] | the heading restricted to one subheading, the qualifier taken from the exact match's subheadings |
"Randomized Controlled Trial"[pt] | publication type |
McMurray JJ[au], <orcid>[auid] | author name; author ORCID |
"N Engl J Med"[ta] | journal abbreviation |
2019[dp], 2026/10/20:2026/10/31[edat] | publication date; date added to PubMed (ranges as start:end) |
<doi>[doi] | DOI |
pubmed pmc[sb] | records with a PMC copy |
- Read
noticebefore using a count. It flags a field tag PubMed did not recognize and searched as free text (heart failure[xyz]returned 385,186 unrestricted records) and a clause that matched nothing, with advice by the clause's field: resolve a MeSH-vocabulary clause withpubmed_lookup_meshand search itssearchTerm, give a journal as its NLM abbreviation (N Engl J Med) or ISSN, and a language as its English name or three-letter code (english,eng;enmatches nothing). Fix the query; never report that count. A page that reaches PubMed's 9,999-record window says how many matches nooffsetreaches; split the query bydateRange. - Screen by language from the results. Search summaries and
pubmed_find_relatedrows carrylanguages(NLM codes such asger), sopubmed_fetch_articlesis not needed for it. A record in another language that NLM has indexed has an Englishtitle, usually in square brackets; a recent one not yet indexed can still show its original-language title, so screen onlanguages, not on the title. - Read
pubmed_spell_check'snotice. A correction PubMed barely holds (under a tenth of the word's records) is dropped and the word kept;noticenames any correction applied without that check because it could not run, and any word kept without its MeSH-spelling check. Verify those with a search before relying oncorrected. - A MeSH term is the descriptor
name, never a synonym."SGLT2 inhibitors"[MeSH Terms]matched nothing although the descriptor lists it as an entry term;Sodium-Glucose Transporter 2 Inhibitorsis the name. Look the concept up first and search the record'ssearchTerm: a supplementary concept (a specific drug or chemical) is searched as"Name"[nm], because no[mh]clause matches it, andmeshTermstakes headings only, so it goes inquery. - A heading introduced inside the searched dates can miss earlier literature. A record with
yearIntroducedinside the date range was indexed before then under the headings in itspreviousIndexing. Look each up withpubmed_lookup_meshby name, without its years, and search thesearchTermreturned. A current heading returns its own; a retired one matches nothing as[mh]and resolves to the heading that holds its records:"Heart Failure, Congestive"[mh]matched 0 with2000:2005[dp], and the lookup returns"Heart Failure"[mh], which matched 15,780. - MeSH misses the newest records. Indexing lags, so for records added 2026-10-01 to 2026-11-02
"Heart Failure"[mh]matched 212 and"heart failure"[tiab]1,747. OR each MeSH clause with[tiab]synonyms from the descriptor's entry terms whenever recent work counts. - A drug class needs
[pa]beside[mh]. An article about one drug is indexed under that drug's headings, not its class: 38320128, "Dapagliflozin and Anemia in Patients with Chronic Kidney Disease", carries no SGLT2-inhibitor heading."Sodium-Glucose Transporter 2 Inhibitors"[pa] NOT "Sodium-Glucose Transporter 2 Inhibitors"[mh]returned 2,354 such records.pubmed_lookup_meshlists such a class twice with one name and MeSH ID, the descriptor first (recordTypedescriptor) and then its pharmacological-action record (pharmacological-action); the one name serves both tags. [mh]explodes."Heart Failure, Systolic"[mh] NOT "Heart Failure"[mh]is 0; the same against[mh:noexp]is 1,429. Use[mh:noexp]when the narrower headings don't belong.- A quoted phrase is exact; use proximity for words near each other.
"dapagliflozin mortality"[tiab]matched nothing (the notice names the clause);"dapagliflozin mortality"[tiab:~3]matched 47. - Free full text is not a PMC copy. The free-full-text filter counts articles free anywhere (141,777 for
"heart failure"[tiab]);AND pubmed pmc[sb]in its place matches the 101,121 with a PMC copy, the tierpubmed_fetch_fulltextreads first. - Batch, don't loop. Without an API key the server spaces NCBI requests 400 ms apart across all its callers, so parallel calls only queue. Pass many IDs per call; each tool's array limit is in its schema.
Resolving references
- One wrong field sinks an ECitMatch lookup. 31535829 cited with year 2020 came back
not_found, not matched with a warning; the same citation without the year matched.The Lancetfailed whereLancetandNew England Journal of Medicinematched. Retry anot_foundwith the doubtful field dropped, or the journal as its NLM abbreviation (Lancet), before falling back to search. - A title search returns the paper's correspondence too.
"Dapagliflozin in Patients with Heart Failure and Reduced Ejection Fraction"[ti]returned 9 records: the trial (31535829), five more under the same title (32130820 is a NEJM letter typed Letter and Comment), and three longer titles containing it. Pick by publication type, first author, and date frompubmed_fetch_articles.
Citations and full text
cited_byis not a citation count. For 31535829,pubmed_find_relatedcited_bytotals 3,381, iCite'scitationCount5,579, and Europe PMC'scitedByCount5,400. Report iCite's count or RCR for how cited a paper is; usecited_byto list citing PubMed records.- A
sectionsfilter that matched in part is not a missing section. When some terms matched an article and others did not, thenoticenames the unmatched terms per article; a results section titled "Findings" misses a filter on "Results". Call again withoverflowModeoutline, a smallmaxCharacters, and nosectionsto read the article's headings, then filter by those. - An
unavailableentry is not proof that no free full text exists.unqueriedTiersnames a tier this deployment skipped that could have served it (Unpaywall withoutUNPAYWALL_EMAIL),fetch-failedcan mean an Unpaywall copy over the 50 MiB read limit (the tierdetailsays), anot-attemptedtier whosedetailsays the tool call's deadline left it no time was never asked (call again for that id alone), andservice-erroris an upstream failure: Europe PMC answered PPR829124's full text with HTTP 500 although its search hit sethasFullTextXml. Say which tiers answered.
Workflows
Systematic search. pubmed_spell_check the user's terms, then pubmed_lookup_mesh each concept for its searchTerm and entry terms. Build ("Descriptor"[mh] OR synonym[tiab] OR …) AND (…) from the searchTerm clauses per the gates, adding [pa] for a drug class. Size it with maxResults 0 and read notice, then add publication types and dates. PubMed serves only the first 9,999 records of a set, so split a larger one by date range. Fetch metadata with pubmed_fetch_articles in batches, then full text for the included set. Run the same concepts as free text through pubmed_europepmc_search with sources PPR for preprints.
Resolve a reference list. Split each reference into journal, year, volume, first page, and first author, and send them to pubmed_lookup_citation 25 at a time. On matched, compare matchedFirstAuthor and read warnings; on ambiguous, fetch the candidatePmids and pick; on not_found, apply the ECitMatch gate, then a [ti] search, then TITLE:"…" in pubmed_europepmc_search for preprints. Format with pubmed_format_citations, whose notices carry retractions and errata.
How cited is this paper. Resolve it to a PMID, then pubmed_fetch_citation_metrics for RCR, NIH percentile, and citation count; a paper added this year may not be scored yet (42951449, October 2026). Check pubmed_fetch_articles for a retraction before relying on the numbers: 9500320 keeps RCR 41.0 and the 99.8th percentile though its publication types include Retracted Publication. pubmed_find_related cited_by then lists citing records to read. For the clinical articles citing it, set includeClinicalCitations on pubmed_fetch_citation_metrics and pass the clinicalCitationPmids to pubmed_fetch_articles; the list is uncapped, so ask for it on a few papers at a time.
A preprint or a record PubMed lacks. pubmed_europepmc_search with sources PPR; add AND HAS_FT:Y to keep records with full text (16 of 69 preprints on dapagliflozin and heart failure). pubmed_europepmc_fetch returns the whole abstract; pubmed_fetch_fulltext with the DOI returns the body when Europe PMC holds it (10.21203/rs.3.rs-8604461/v1 did).
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

