Search NCBI databases (ESearch)
ncbi_esearchSearch NCBI Entrez databases with field-tagged queries to retrieve matching record IDs for summary, fetch, or SPARQL anchoring.
Instructions
Search NCBI Entrez databases with E-utilities ESearch (https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi) and return the matching record IDs, for use with ncbi_esummary / ncbi_efetch or as SPARQL anchors.
Recall depends heavily on NCBI field tags for Gene, ClinVar and similar databases: an untagged query is matched loosely and misses most relevant records. Gene field tags: • [Organism] - taxonomic filter (e.g. "Homo sapiens[Organism]", "Archaea[Organism]") • [Gene Name] - gene symbol (e.g. "TP53[Gene Name]", "nifH[Gene Name]") • [All Fields] - broad keyword (e.g. "nitrogenase[All Fields]")
Measured on Gene for archaeal nitrogenase genes: • query="Archaea[Organism] AND (nifH[Gene Name] OR nitrogenase[All Fields])" → ~1,300 records (full recall) • query="archaea AND nifH" → ~300 records (~23% recall)
RETURNS formatted text results carrying the database-specific IDs. On a
missing/invalid database or query it returns a single text item whose
message begins with "Error:" — check for that prefix before using the IDs.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "ncbi_esearch"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| db | No | Alias for `database`. | |
| term | No | Alias for `query`. | |
| query | No | Search query with NCBI field tags and boolean operators (alias: `term`) | |
| retmax | No | Alias for `max_results` (the E-utilities name). | |
| sort_by | No | Optional sort order (e.g., "relevance", "pub_date" for PubMed) | |
| database | No | NCBI database name (alias: `db`). Supported values: - "gene" or "ncbigene": NCBI Gene database ⚠️ FIELD TAGS CRITICAL - "taxonomy": NCBI Taxonomy (organism information) - "clinvar": ClinVar (genetic variants) ⚠️ FIELD TAGS CRITICAL - "medgen": MedGen (medical genetics concepts) - "mesh": MeSH (Medical Subject Headings) - "pubmed": PubMed (biomedical literature) - "pccompound": PubChem Compound - "pcsubstance": PubChem Substance - "pcassay": PubChem BioAssay | |
| retstart | No | Alias for `start_index` (the E-utilities name). | |
| max_results | No | Maximum number of results to return (default: 20; alias: `retmax`) | |
| start_index | No | Starting index for pagination (default: 0; alias: `retstart`) | |
| search_field | No | Optional specific field to search in |