ncbi-sequence-fetch
Skill0 starsChanged 25 days agoApache-2.0View on GitHub
Retrieve protein and nucleotide sequences from NCBI databases using E-utilities. Supports direct accession lookup, CDS translation, gene+organism search, locus lookup, PubMed-linked sequences, patent protein extraction, and organism+length fallback search. Use when you need to fetch biological sequences by accession, gene name, locus tag, PubMed ID, or patent number.
- Reads credentials
3 other projects use a version of this, 2 of them edited.
Adopted by
Most recently taken up by
- 1stANUNNAKI/majlisedited, first seen Nov 8, 2026
- google-deepmind/science-skillsword for word, first seen Jul 1, 2026
- uppifyagency/boilerplate-saas-2026edited, first seen Jun 2, 2026
Other versions3 projects use a version of this.
Word for word · 1
- google-deepmind/science-skills★ 3.4k100% same
Edited · 2
- 1stANUNNAKI/majlis★ 288% same
- uppifyagency/boilerplate-saas-2026★ 189% same
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository40 other files it gives its agents.
- vector-geneSkill
- alphafold-database-fetch-and-analyzeSkill
- alphagenome-atlas-website-linksSkill
- alphagenome-single-variant-analysisSkill
- alphagenome-variant-impact-scoreSkill
- chembl-databaseSkill
- clinical-trials-databaseSkill
- clinvar-databaseSkill
- credentialsSkill
- dbsnp-databaseSkill
- embl-ebi-olsSkill
- encode-ccres-databaseSkill
- ensembl-databaseSkill
- foldseek-structural-searchSkill
- gnomad-databaseSkill
- gtex-databaseSkill
- human-protein-atlas-databaseSkill
- interpro-databaseSkill
- jaspar-databaseSkill
- literature-search-arxivSkill
- literature-search-biorxivSkill
- literature-search-europepmcSkill
- literature-search-openalexSkill
- openfda-databaseSkill
- opentargets-databaseSkill
- pdb-databaseSkill
- predictingthepastSkill
- protein-sequence-msaSkill
- protein-sequence-similarity-searchSkill
- pubchem-databaseSkill
- pubmed-databaseSkill
- pymolSkill
- quickgo-databaseSkill
- reactome-databaseSkill
- string-databaseSkill
- ucsc-conservation-and-tfbsSkill
- unibind-databaseSkill
- uniprot-databaseSkill
- uvSkill
- workflow-skill-creatorSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
13 rules. About 0 are common, 6 are distinctive, and 7 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 15
uv: Read the uv skill and follow its Setup instructions to ensure uv is installed and on PATH. - Very specific: line 17
User Notification: If .licenses/ncbi_sequence_fetch_LICENSE.txt does not already exist in the workspace root directory then (1) prominently …
- Very specific: line 22
.envfile: Make sure the .env file exists in your home directory. - Distinctive: line 23
Create one if it does not exist.
- Distinctive: line 33
Use the Wrapper: ALWAYS execute the provided helper scripts to query the database rather than accessing the database directly.
- Very specific: line 36
API Key Support: If the user provides an NCBI_API_KEY in their environment, the query speed limits are automatically increased …
- Distinctive: line 39
Notification: If this skill is used, ensure this is mentioned in the output.
- Very specific: line 63
All subcommands write structured JSON output.
- Very specific: line 97
If the accession is a genomic record (not mRNA/CDS), the tool will report is_genomic: true so you can fall back to a homology-based …
- Distinctive: line 124
Follow NCBI's cross-database links (e.g., PubMed article → linked proteins).
- Distinctive: line 200
When trying to find a protein sequence, follow this priority order:
- Very specific: line 212
All subcommands return JSON with a results array
- Distinctive: line 214
When multiple results are returned, select by:
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
NCBI Sequence Fetch
Prerequisites
uv: Read theuvskill and follow its Setup instructions to ensureuvis installed and on PATH.- User Notification: If .licenses/ncbi_sequence_fetch_LICENSE.txt does not already exist in the workspace root directory then (1) prominently notify the user to check the terms at https://www.ncbi.nlm.nih.gov/ and https://www.ncbi.nlm.nih.gov/home/about/policies/, then (2) create the file recording the notification text and timestamp.
.envfile: Make sure the.envfile exists in your home directory. Create one if it does not exist.NCBI_API_KEY(optional): Raises the NCBI rate limit from 3 to 10 requests/second. The skill works without it, but a key is recommended if the user plans many queries or encounters a 429 error. You can register for a key for free at https://www.ncbi.nlm.nih.gov/account/settings/. You MUST use the safe credentials protocol in thecredentialsskill to check for and request this key if this skill looks relevant to the user's request.
Core Rules
- Use the Wrapper: ALWAYS execute the provided helper scripts to query the database rather than accessing the database directly. The scripts automatically enforce the required rate limit gracefully.
- API Key Support: If the user provides an
NCBI_API_KEYin their environment, the query speed limits are automatically increased significantly. - Notification: If this skill is used, ensure this is mentioned in the output.
Overview
Wraps NCBI's Entrez E-utilities (efetch, esearch, elink, esummary) for retrieving protein and nucleotide sequences. Provides 10 subcommands covering the full range of sequence retrieval workflows:
fetch-protein— Direct protein accession lookup (GenPept, RefSeq)fetch-nucleotide— Direct nucleotide accession lookupcds-translate— Fetch CDS and translate to protein (3 methods)search— Free-text search of any NCBI databaseelink— Follow cross-database links (PubMed→Protein, etc.)gene-protein— Search protein by gene name + organismlocus-protein— Search protein by locus tag + organismpubmed-proteins— Find proteins linked to a PubMed articlepatent-search— Extract protein sequences from patentsorganism-length— Last-resort search by organism + exact AA length
Utility Scripts
scripts/ncbi_fetch.py — Single script with subcommands.
All subcommands write structured JSON output. Use --output FILE to save to a
file, or omit it to print to stdout. A human-readable summary is always printed
to stdout.
1. Fetch Protein by Accession
Fetches protein FASTA from NCBI by accession (XP_, NP_, GenPept, etc.)
uv run scripts/ncbi_fetch.py fetch-protein XP_022033624 -o /tmp/result.json
uv run scripts/ncbi_fetch.py fetch-protein NP_001234567 ABC12345.12. Fetch Nucleotide by Accession
Fetches nucleotide FASTA from NCBI by accession.
uv run scripts/ncbi_fetch.py fetch-nucleotide MK034466 -o /tmp/result.json3. CDS Translate
Fetches a CDS/nucleotide accession and translates to protein sequence. Tries
three approaches in order: 1. NCBI's pre-translated CDS protein (fasta_cds_aa)
- GenBank XML CDS annotation translations 3. Raw nucleotide → 6-frame ORF finding
uv run scripts/ncbi_fetch.py cds-translate MK034466 -o /tmp/result.json
uv run scripts/ncbi_fetch.py cds-translate HQ662330 --target-length 1043If the accession is a genomic record (not mRNA/CDS), the tool will report
is_genomic: true so you can fall back to a homology-based approach instead.
4. Search Any Database
Free-text search using Entrez query syntax. Supports all NCBI databases.
# Search protein database
uv run scripts/ncbi_fetch.py search "WRR4B[Gene Name] AND Arabidopsis[Organism]" \
--database protein --retmax 5 --fetch-sequences
# Search nucleotide database
uv run scripts/ncbi_fetch.py search "Rz2[Gene Name] AND Beta vulgaris[Organism]" \
--database nuccore --retmax 10
# Search with patent filter
uv run scripts/ncbi_fetch.py search "disease resistance AND Solanum[Organism] AND patent[Properties]" \
--database protein --fetch-sequences
# Search by sequence length
uv run scripts/ncbi_fetch.py search '"Oryza sativa"[Organism] AND 1043[SLEN]' \
--database protein --fetch-sequences --retmax 505. Cross-Database Links (elink)
Follow NCBI's cross-database links (e.g., PubMed article → linked proteins).
uv run scripts/ncbi_fetch.py elink 24896089 --dbfrom pubmed --db protein \
--fetch-sequences -o /tmp/linked.json6. Gene + Organism Search
Searches for protein sequences by gene name and organism. Searches NCBI Protein
with [Gene Name] and [Organism] qualifiers.
uv run scripts/ncbi_fetch.py gene-protein WRR4B --organism "Arabidopsis thaliana"
uv run scripts/ncbi_fetch.py gene-protein Pikh-2 --organism "Oryza sativa" \
--target-length 1043 -o /tmp/result.json7. Locus Tag Search
Searches by locus tag in both NCBI Protein and Nuccore databases. Extracts CDS translations from GenBank XML when direct protein hits aren't available.
uv run scripts/ncbi_fetch.py locus-protein At1g56540 --organism "Arabidopsis thaliana"
uv run scripts/ncbi_fetch.py locus-protein Niben101Scf02422g02015.1 \
--organism "Nicotiana benthamiana" -o /tmp/result.json8. PubMed-Linked Proteins
Finds protein sequences linked to a PubMed article. Searches NCBI Protein by PMID, follows elink PubMed→Protein, and extracts CDS translations from linked Nuccore records.
uv run scripts/ncbi_fetch.py pubmed-proteins 30692254 --identifier WRR4B
uv run scripts/ncbi_fetch.py pubmed-proteins 24896089 --identifier "K2" \
-o /tmp/result.json9. Patent Sequence Search
Two modes:
By patent number — fetches all protein sequences from a specific patent:
bash uv run scripts/ncbi_fetch.py patent-search --patent-number US10123456 -o
/tmp/patent.json
By keywords — searches NCBI Protein with patent[Properties] filter: bash
uv run scripts/ncbi_fetch.py patent-search --keywords WRR4B Albugo --organism
"Arabidopsis thaliana" -o /tmp/patent.json
[!IMPORTANT] Patent convention: In molecular biology patents, SEQ ID NO: 1 is typically the DNA sequence and SEQ ID NO: 2 is the primary protein. Higher SEQ ID NOs are variants or related sequences. Prefer Sequence 2 when selecting the primary protein of interest.
10. Organism + Length Search
Last-resort search when only organism and expected protein length are known.
Uses NCBI's [SLEN] filter for exact length matching.
uv run scripts/ncbi_fetch.py organism-length \
--organism "Arabidopsis thaliana" --length 1048 --retmax 50 \
-o /tmp/result.json[!NOTE] This often returns multiple candidates. Use the JSON output headers to identify the correct protein.
Workflow
Standard Sequence Retrieval Cascade
When trying to find a protein sequence, follow this priority order:
- Direct accession —
fetch-proteinwith GenPept/RefSeq accession - CDS translation —
cds-translatewith nucleotide/CDS accession - PubMed-linked —
pubmed-proteinswith PMID + gene name - Locus lookup —
locus-proteinwith locus tag + organism - Gene + organism —
gene-proteinwith gene name + organism - Patent search —
patent-searchwith patent number or keywords - Organism + length —
organism-lengthas last resort
Interpreting Results
- All subcommands return JSON with a
resultsarray - Each result has
sequence(AA string),length, andheader/metadata - When multiple results are returned, select by:
- Closest match to expected length (
target_length) - Header relevance (matching gene name, "disease resistance" keywords)
- Source priority (RefSeq > GenPept > patent)
- Closest match to expected length (
Reference
- NCBI E-utilities docs: https://www.ncbi.nlm.nih.gov/books/NBK25499/
- Entrez search syntax: https://www.ncbi.nlm.nih.gov/books/NBK49540/
- Database list: protein, nuccore, gene, pubmed, pmc, biosample, etc.
- Common accession formats:
XP_/NP_— NCBI RefSeq proteinAAAtoAZZ+ digits — GenPept (translated GenBank)MK,MN,HQ, etc. + digits — GenBank nucleotideENSG,ENST,ENSP— Ensembl (useensembl-databaseskill instead)Q,P,O+ digits — UniProt (useuniprot-databaseskill instead)
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

