biothings_download_entrez_data
Retrieve biological sequence or record data from NCBI Entrez databases by providing IDs, database name, and format (FASTA or GenBank).
Instructions
Download data from NCBI Entrez databases using Bio.Entrez.
Downloads data records from specified NCBI Entrez databases. This tool is designed to be called
by automated agents (like LLMs) or other services.
**Critical Configuration:**
The server hosting this API *must* have the `ENTREZ_EMAIL` environment variable set
to a valid email address. NCBI requires this for Entrez queries to monitor usage
and prevent abuse. Without it, NCBI may block requests.
**Parameters:**
- `ids` (List[str], required): A list of unique identifiers for the records to fetch
from the specified Entrez database. Example: `["NM_000546.6", "AY123456.1"]`
- `db` (DB_LITERAL, required): The target NCBI Entrez database.
Common choices for sequences: 'nucleotide', 'protein'.
Other examples: 'gene', 'pubmed', 'taxonomy'.
Ensure the `ids` provided are appropriate for the selected `db`.
- `reftype` (Literal["fasta", "gb"], required): The desired format for the
downloaded data.
- "fasta": Returns data in FASTA format.
- "gb": Returns data in GenBank format.
Ensure the chosen `reftype` is compatible with the selected `db`.
**Returns:**
On success: Returns the downloaded data as a single raw string with the
data fetched from Entrez in the specified `reftype`.
**Example Usage:**
To fetch the FASTA sequence for human TP53 mRNA (NM_000546.6):
```
download_entrez_data(
ids=["NM_000546.6"],
db="nucleotide",
reftype="fasta"
)
```
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| db | Yes | ||
| ids | Yes | ||
| reftype | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |