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

Open in playground
kirha tools run pubmed_searchPubmed \
  --input '{}'

Uses the key saved by kirha auth login.

  • ageGroupstring

    Filter 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 false

    If true, only return the total count of matching articles without fetching summaries. Useful to estimate result size

  • dateRangeobject

    Optional date range filter. If not provided, searches all time. Takes precedence over recentDays

    Show 3 fields
    • maxDatestring, required

      End date in YYYY/MM/DD, YYYY/MM, or YYYY format

    • minDatestring, required

      Start 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

  • languagestring

    Filter results by article language

    One of english, french, german, spanish, chinese, japanese, russian, portuguese, italian, korean

  • maxResultsnumber, default 20, 1 to 100
  • meshFieldTypestring, 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 items

    Array 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 9998

    Starting 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 characters

    Free-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 1

    Return 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

  • sexstring

    Filter 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

  • speciesstring

    Filter by species studied

    One of humans, animals

  • textAvailabilitystring

    Filter by text availability: hasAbstract, freeFullText (open access), fullText (any full text link)

    One of hasAbstract, freeFullText, fullText