searchPubmed
1 credit per call
Search PubMed for scientific articles. Returns article summaries (title, authors, journal, publication date, DOI) for each result. Use fetchPubmedArticles with the returned pmIds to get full article details (abstract, MeSH terms). Two search modes: (1) query string for most searches — use plain keywords like 'CRISPR gene therapy cancer'; (2) meshTerms array ONLY when the user explicitly asks for MeSH-based or MeSH major topic searching — call lookupMeshTerms first, then pass results here. Default to query for general searches. Only use meshTerms when MeSH precision is explicitly requested. Supports filters for language/species/age/sex, text availability, date filtering, and pagination. Searches all time by default. Use dateRange or recentDays to filter by date.
Try it
kirha tools run pubmed_searchPubmed \
--input '{}'Uses the key saved by kirha auth login.
ageGroupstringFilter by age group using MeSH terms. Use this instead of adding age terms (e.g. 'elderly', 'children') in the query. newborn=birth-1mo, infant=birth-23mo, preschoolChild=2-5y, child=6-12y, adolescent=13-18y, youngAdult=19-24y, adult=19-44y, middleAged=45-64y, aged=65+, aged80AndOver=80+
One of newborn, infant, preschoolChild, child, adolescent, youngAdult, adult, middleAged, aged, aged80AndOver
countOnlyboolean, default falseIf true, only return the total count of matching articles without fetching summaries. Useful to estimate result size
dateRangeobjectOptional date range filter. If not provided, searches all time. Takes precedence over recentDays
Show 3 fieldsHide fields
maxDatestring, requiredEnd date in YYYY/MM/DD, YYYY/MM, or YYYY format
minDatestring, requiredStart date in YYYY/MM/DD, YYYY/MM, or YYYY format
dateTypestring, default "pdat"Date type: pdat=publication, edat=entrez, mdat=modification
One of pdat, edat, mdat
languagestringFilter results by article language
One of english, french, german, spanish, chinese, japanese, russian, portuguese, italian, korean
maxResultsnumber, default 20, 1 to 100meshFieldTypestring, default "meshTerms"How to search meshTerms: meshTerms=[mh] matches any MeSH tag, meshMajorTopic=[majr] matches only major topic tags. Only applies when using the meshTerms array parameter
One of meshTerms, meshMajorTopic
meshTermsstring[], 1 to 10 itemsArray of canonical MeSH headings from lookupMeshTerms. ALWAYS use this when lookupMeshTerms was called. Each term is automatically quoted and tagged with the correct field tag. Terms are combined with AND. Example: ['Metformin', 'Diabetes Mellitus, Type 2']. Takes precedence over query
offsetnumber, default 0, 0 to 9998Starting index for pagination (max 9998: PubMed only exposes the first 9,999 matches per search). Use with maxResults to page through results
publicationTypesstring[]One of Review, Systematic Review, Meta-Analysis, Randomized Controlled Trial, Clinical Trial, Case Reports, Observational Study, Practice Guideline, Editorial, Letter, Comment
querystring, At least 3 charactersFree-text search query for general keyword searches. ONLY use this for casual/exploratory searches where MeSH precision is not needed. Do NOT put MeSH headings from lookupMeshTerms here — use the meshTerms array instead. Do NOT include demographic terms (elderly, women, children) — use species, sex, ageGroup filters. Do NOT include publication type terms (review, trial) — use publicationTypes filter. Either query or meshTerms must be provided. If both are given, meshTerms is used and query is ignored
recentDaysnumber, Min 1Return articles from the last N days. Simpler alternative to dateRange. Ignored when dateRange is given
searchFieldstring, default "all"Restrict the free-text query to a specific PubMed field. Only applies when using the query parameter (not meshTerms). all=all fields, title=title only, titleAbstract=title and abstract, author=author name, journal=journal name
One of all, title, titleAbstract, author, journal
sexstringFilter by sex of subjects studied. Maps to MeSH terms Female/Male. Use this instead of adding sex/gender terms (e.g. 'women', 'men') in the query
One of male, female
sortstring, default "relevance"One of relevance, pubDate, author, journal
speciesstringFilter by species studied
One of humans, animals
textAvailabilitystringFilter by text availability: hasAbstract, freeFullText (open access), fullText (any full text link)
One of hasAbstract, freeFullText, fullText