kbase-query

kbase-query is a skill for Claude Code, Codex from openscientist-io/openscientist. It costs 79 tokens per session (1,082 once invoked), scanned A, original, Apache-2.0.

A set of tools for querying the KBase/BERDL Datalake, a data service for biological and microbiome information. It uses the service’s REST API and requires a KBASE_TOKEN.

In plain words
What is it for?
Use it to list databases and tables, inspect schemas and sample records, and run SQL queries against KBase data.
Why use it?
It provides a repeatable way to inspect available databases and data instead of searching through them manually.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to list databases and tables, inspect schemas and sample records, and run SQL queries against KBase data.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/openscientist-io/openscientist/kbase-query
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add openscientist-io/openscientist --skill kbase-query
Clone the repo
git clone --depth 1 https://github.com/openscientist-io/openscientist

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for kbase-query

README.md
[![agentmods](https://agentmods.dev/badge/skills/openscientist-io/openscientist/kbase-query/github.svg)](https://agentmods.dev/skills/openscientist-io/openscientist/kbase-query)
Your own site
<a href="https://agentmods.dev/skills/openscientist-io/openscientist/kbase-query"><img src="https://agentmods.dev/badge/skills/openscientist-io/openscientist/kbase-query/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for kbase-query

Your own site · 80×15
<a href="https://agentmods.dev/skills/openscientist-io/openscientist/kbase-query"><img src="https://agentmods.dev/badge/skills/openscientist-io/openscientist/kbase-query.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 79 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,082 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00079 $0.01082
Opus 5.5 $0.00032 $0.00433
Sonnet 5.5 $0.00016 $0.00216
Haiku 4.5 $0.00008 $0.00108

Measured 2mo ago against content hash e643a4bf16c8, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

kbase-query scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.

The scan reads SKILL.md. This mod also ships 9 executable files (scripts/kbase_db_structure.sh, scripts/kbase_health.sh, scripts/kbase_list_databases.sh, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

resp = requests.post(
skills/domain/berkeley-data-lakehouse/kbase-query/SKILL.md · 150 lines

How it starts

The opening of the file, as written. The whole thing — 150 lines — stays where its author put it; the contents beside it link to each section on GitHub.

KBase Query

Query the KBase/BERDL Datalake MCP Server via REST API using Python.

Setup

The KBASE_TOKEN environment variable must be set. Tokens expire after ~1 week.

Python API Functions

Use execute_code with these helper functions to query the lakehouse:

import os
import requests
import pandas as pd

KBASE_TOKEN = os.environ.get('KBASE_TOKEN')
BASE_URL = 'https://hub.berdl.kbase.us/apis/mcp'

def get_headers():
    return {
        'Authorization': f'Bearer {KBASE_TOKEN}',
        'Content-Type': 'application/json',
        'accept': 'application/json'
    }

def list_databases():
    '''List all available databases'''
    resp = requests.post(
        f'{BASE_URL}/delta/databases/list',
        headers=get_headers(),
        json={'use_hms': True, 'filter_by_namespace': True}
    )
    resp.raise_for_status()
    return resp.json()['databases']

def list_tables(database):
    '''List tables in a database'''
    resp = requests.post(
        f'{BASE_URL}/delta/databases/tables/list',
        headers=get_headers(),
        json={'database': database, 'use_hms': True}
    )
    resp.raise_for_status()
    return resp.json()['tables']

def query(sql, limit=100):
    '''Execute SQL query and return DataFrame'''
    resp = requests.post(
        f'{BASE_URL}/delta/tables/query',
        headers=get_headers(),
        json={'query': sql, 'limit': limit}
    )
    resp.raise_for_status()
    data = resp.json()
    rows = data.get('result', [])
    return pd.DataFrame(rows)

Example Workflow

1. Explore available databases

dbs = list_databases()
print(f"Available databases: {dbs}")
# → ['enigma_coral', 'nmdc_core', 'globalusers_kepangenome_parquet_1', ...]

2. List tables in a database

tables = list_tables('nmdc_core')
print(f"Found {len(tables)} tables: {tables[:10]}")
# → ['annotation_terms_unified', 'cog_categories', 'kegg_ko_module', ...]

3. Query data with SQL

# Simple query
df = query("SELECT * FROM nmdc_core.kegg_ko_module LIMIT 10")
print(df)

# Aggregation query
df = query("""
    SELECT module_id, COUNT(*) as ko_count
    FROM nmdc_core.kegg_ko_module
    GROUP BY module_id
    ORDER BY ko_count DESC
    LIMIT 20
""")
print(df)

# Join query (when needed)
df = query("""
    SELECT a.*, b.description
    FROM nmdc_core.kegg_ko_module a
    JOIN nmdc_core.kegg_modules b ON a.module_id = b.module_id
    LIMIT 10
""")

Read the full file on GitHub · 150 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2mo ago First seen · 150 lines · 79 tokens per session scan A e643a4bf16c8

Subscribe to this mod's changes

kbase-query is a skill published in the GitHub repository openscientist-io/openscientist (63 stars, last pushed yesterday), licensed Apache-2.0. It adds 79 tokens to every session and 1,082 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

kbase-query compared with skills from other repositories

kbase-query next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
kbase-queryopenscientist-io/openscientistSkill63yesterdayApache-2.0A79Claude Code, Codex
tiledbvcfK-Dense-AI/scientific-agent-skillsSkill56k4d agoMITA62Claude Code, Codex
lamindbK-Dense-AI/scientific-agent-skillsSkill56k4d agoMITA58Claude Code, Codex
defining-cohort-phenotypesmaziyarpanahi/openmedSkill5.8kyesterdayApache-2.0A191Claude Code
benchling-integrationsynthetic-sciences/openscienceSkill4.3k2d agoApache-2.0A44Claude Code, Codex
chembl-databasegoogle-deepmind/science-skillsSkill3.4k14d agoApache-2.0A53Claude Code, Codex
nvalchemi-data-storageNVIDIA/nvalchemi-toolkitSkill204todayApache-2.0A90Claude Code