genbank_get
Fetch GenBank/RefSeq nucleotide records by accession as GenBank flat-file or FASTA text, including sequence regions for large records.
Instructions
Fetch a GenBank/RefSeq nucleotide record as text (GenBank flat file or FASTA).
Whole-record fetches are capped at 2,000,000 bp — larger records require a seq_start/seq_stop region (1-based, inclusive, up to 10 Mb span; set strand=2 for a reverse-strand slice where seq_start > seq_stop — the region field echoes the request as given, while NCBI's text shows complement(min..max)). Output: records up to 1,000 characters are returned inline (sequence_text with char_count/truncated). Anything larger defaults to file mode — the FULL text is written to a server-side cache file and the reply carries mode:"file", file_path, char_count, and total_char_count instead of sequence_text (never truncated); Read/Grep the file selectively. The cache is ephemeral (pruned after ~7 days / 500 files) and the path is server-local; re-call to regenerate. sequence_output:"inline" opts back into inline text capped at 200,000 characters — use it only if you cannot read server-side files.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| format | No | Record format: genbank flat file (default) or fasta | genbank |
| strand | No | Strand: 1=plus (default), 2=minus (reverse slice; allows seq_start > seq_stop) | |
| seq_stop | No | Region stop (1-based, inclusive) | |
| accession | Yes | GenBank/RefSeq accession, versioned or bare — NC_000023.11, NG_017013.2, KJ668569.1, NC_000908.2 | |
| seq_start | No | Region start (1-based, inclusive) — required with seq_stop for records over 2 Mb | |
| sequence_output | No | Output mode: "file" (default) writes records over 1,000 characters whole to a server-side cache file and returns file_path + char counts (full data, never truncated); "inline" returns sequence_text inline, capped at 200,000 characters — use only if you cannot read server-side files | |
| max_response_bytes | No | Hard cap on the raw NCBI response in characters (default 30,000,000) — oversized responses error instead of truncating |