---
title: PubMed Search inputs and parameters
description: 'Input formats, parameters, and validation for PubMed literature search.'
tags:
  - pubmed
  - inputs
---

You search by a text query — plain-English terms or raw PubMed syntax with field tags. How precisely you scope that query (field tags, Boolean operators, date ranges) is what most affects which publications come back.

## Input methods

You run a PubMed search by asking Ivy in chat, in plain English or in PubMed syntax. There is no form, job, or command for it.

## Chat input (natural language)

Type a search request in plain English. The orchestrator detects PubMed intent and constructs the appropriate query.

**Examples:**
```
Search PubMed for KRAS G12C inhibitors
Find papers on mRNA vaccine delivery published after 2023
Show me reviews about CAR-T cell therapy in solid tumors
```

The orchestrator handles query construction, field tag insertion, and date formatting automatically. You can also provide raw PubMed syntax if you prefer:

```
Search PubMed for "BRCA1[Gene] AND breast cancer[MeSH] AND 2024[DP]"
```

## What you can ask for

### Plain search

A plain search runs ESearch, then ESummary and EFetch in parallel, so it returns full records — abstract, MeSH terms, and keywords — not just metadata.

| You can set | Default | Limits |
|-------------|---------|--------|
| Query | Required | Plain English or PubMed syntax with field tags. No enforced maximum length, but keep it short — 2-4 terms — since PubMed matches against MeSH indexing, not free keyword search |
| Number of results | 20 | 1-100 |

### Filtered search

When you ask for a filter by author, affiliation, date range, or article type, Ivy runs a filtered search that builds the field-tagged query for you. It only calls ESearch + ESummary — not EFetch — so its results have no abstract, MeSH terms, or keywords. To keep the abstracts, ask for the filter as a field tag inside the query instead (see [Field tags](#field-tags)).

| Filter | Default | Limits |
|--------|---------|--------|
| Query | Required | 2-500 characters, with optional field tags |
| Author | None | An author name (applied as an `[AU]` tag) |
| Affiliation | None | An institution or affiliation (applied as an `[AD]` tag) |
| Date range | None | A start and/or end date as YYYY/MM/DD or YYYY |
| Article type | Any | Review, clinical trial, meta-analysis, or case report |
| Number of results | 20 | 1-100 |

You cannot filter by journal or MeSH term outside the query, and results cannot be re-sorted — ESearch always sorts by relevance. Put a journal (`[TA]`) or MeSH (`[MH]`) tag in the query instead.

## Query syntax

### Free-text queries

Simple keyword searches match against title, abstract, and MeSH terms:

```
kinase inhibitor resistance mechanisms
```

### Boolean operators

Combine terms with AND, OR, NOT (must be uppercase):

```
EGFR AND resistance AND NOT review[PT]
```

### Field tags

Restrict searches to specific fields:

| Tag | Field | Example |
|-----|-------|---------|
| `[TI]` | Title | `CRISPR[TI]` |
| `[TIAB]` | Title or Abstract | `checkpoint inhibitor[TIAB]` |
| `[AU]` | Author | `Doudna JA[AU]` |
| `[AD]` | Affiliation | `Harvard[AD]` |
| `[TA]` | Journal | `Nature[TA]` |
| `[MH]` | MeSH Terms | `Neoplasms[MH]` |
| `[PT]` | Publication Type | `Review[PT]` |
| `[DP]` | Date Published | `2024[DP]` |
| `[GENE]` | Gene symbol | `TP53[GENE]` |

### Date ranges

Filter by publication date:

```
EGFR inhibitors AND 2023/01/01:2024/12/31[DP]
```

Or ask for a date range in plain words ("published between 2023 and 2024").

### Phrase searching

Use double quotes for exact phrases:

```
"checkpoint inhibitor" AND "non-small cell lung cancer"
```

### Truncation

Use an asterisk for wildcard matching:

```
immun* AND therap*
```

This matches "immunotherapy", "immunotherapeutic", "immune therapy", etc.

## Input validation

### Query validation

- **Plain search**: minimum 1 character, no enforced maximum
- **Filtered search**: minimum 2 characters, maximum 500 characters
- **Empty queries**: Rejected with an error message
- **Special characters**: PubMed syntax characters (`[`, `]`, `"`, `*`, `AND`, `OR`, `NOT`) are preserved as search operators

### Date validation

- **Accepted formats**: YYYY, YYYY/MM, YYYY/MM/DD
- **Range check**: the start date must be before the end date when both are given
- **Future dates**: Accepted but will return no results
- **Invalid formats**: Silently ignored (search proceeds without date filter)

### Limit validation

- **Minimum**: 1
- **Maximum**: 100
- **Values outside range**: Clamped to nearest boundary
- **Non-integer values**: Rounded down

## Example prompts

### Simple keyword search

```
Search PubMed for CRISPR gene editing in cancer, top 20 papers
```

### Filtered search

```
Find reviews on kinase inhibitor resistance by Kantarjian H, published 2022-2024, up to 50 results
```

### MeSH-based search

A MeSH field tag in the query keeps this a plain search, so abstracts and MeSH terms come back:

```
Search PubMed for "Protein Kinases[MH] AND Drug Resistance, Neoplasm[MH]", 30 results
```

### Author and institution search

```
Find papers on CAR-T cells by June CH at the University of Pennsylvania
```

## Batch processing strategies

PubMed Search does not support true batch queries in a single API call. For multi-term searches:

- **Sequential queries**: Run separate searches for each term and review results independently
- **Boolean combination**: Combine related terms in a single query using OR operators
- **Workflow chaining**: Ask the model to pull terms from a prior result's abstracts and generate follow-up PubMed queries

## Read next
