Kbase query
npx -y skills add cmungall/lakehouse-skills --skill kbase-queryAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
- 2 stars2 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Skills for querying the KBase/BERDL Datalake via the MCP REST API. Use this when users want to explore KBase databases, list tables, get schemas, sample data, or run SQL queries against the KBase data lake. Triggers on mentions of KBase, BERDL, or requests to query biological/microbiome data stored in KBase.
SKILL.md
2.8 KB, 720 tokens by cl100k_base, as published. Nobody here has run it
KBase Query
Query the KBase/BERDL Datalake MCP Server via REST API.
Setup
export KBASE_TOKEN="your_token_here"
export KBASE_MCP_URL="https://hub.berdl.kbase.us/apis/mcp" # optional default
Getting your token
- Login to the KBase JupyterHub
- In any notebook, run:
BERDLSettings().KBASE_AUTH_TOKEN - Copy the token value
Note: Tokens expire after ~1 week. If you get auth errors, refresh your token.
Scripts
All scripts require KBASE_TOKEN env var and jq installed.
| Script | Usage |
|---|---|
kbase_health.sh | Check API health |
kbase_list_databases.sh | List all databases |
kbase_list_tables.sh <db> | List tables in database |
kbase_table_schema.sh <db> <table> | Get table columns |
kbase_db_structure.sh [with_schema] | Full DB structure |
kbase_table_count.sh <db> <table> | Row count |
kbase_table_sample.sh <db> <table> [limit] | Sample rows (max 100) |
kbase_query.sh <sql> [limit] | Execute SQL (max 1000) |
kbase_select.sh <db> <table> [limit] | Structured select |
Example Workflow
# List databases
kbase_list_databases.sh
# → {"databases": ["kbase_ke_pangenome", "nmdc_core", ...]}
# List tables in pangenome database
kbase_list_tables.sh kbase_ke_pangenome
# → {"tables": ["genome", "gene", "gene_cluster", ...]}
# Get columns for a table (returns names only, not types)
kbase_table_schema.sh kbase_ke_pangenome genome
# → {"columns": ["genome_id", "gtdb_species_clade_id", ...]}
# Sample rows
kbase_table_sample.sh kbase_ke_pangenome genome 5
# SQL query
kbase_query.sh "SELECT * FROM kbase_ke_pangenome.genome LIMIT 10"
Useful jq Patterns
# Extract just database names
kbase_list_databases.sh | jq -r '.databases[]'
# Get columns as comma-separated list
kbase_table_schema.sh kbase_ke_pangenome genome | jq -r '.columns | join(", ")'
# Loop through all tables to get schemas
for t in $(kbase_list_tables.sh kbase_ke_pangenome | jq -r '.tables[]'); do
echo "=== $t ==="
kbase_table_schema.sh kbase_ke_pangenome "$t" | jq -r '.columns | join(", ")'
done
Available Databases
Key databases include:
kbase_ke_pangenome- Pangenomic data with GTDB taxonomynmdc_core- NMDC microbiome datakbase_genomes- KBase genome collectionkbase_uniprot_*- UniProt reference data
API Reference
See references/api_reference.md for complete endpoint documentation.
What ships with it: 10 files
9.1 KB alongside SKILL.md, 9 of them executable
references/
- api_reference.md4.3 KB
scripts/
- kbase_db_structure.shruns527 B
- kbase_health.shruns308 B
- kbase_list_databases.shruns420 B
- kbase_list_tables.shruns527 B
- kbase_query.shruns544 B
- kbase_select.shruns676 B
- kbase_table_count.shruns612 B
- kbase_table_sample.shruns694 B
- kbase_table_schema.shruns627 B