CONTRACT

A cross-language specification for chDB's agent tool, which lets an AI agent query and inspect data through chDB, an analytical database engine.

In plain words
What is it for?
Use it when implementing or checking chDB agent-tool bindings, including their query, inspection, safety, and capability behavior.
Why use it?
It keeps the Python and TypeScript versions consistent so the same operation has the same meaning in each language.

Agent

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.

agentmods
npx agentmods add agents/chdb-io/chdb/contract
Clone the repo
git clone --depth 1 https://github.com/chdb-io/chdb
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 3,500 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00000 $0.03500
Opus 5 $0.00000 $0.01750
Sonnet 5 $0.00000 $0.00700
Haiku 4.5 $0.00000 $0.00350

Measured yesterday against content hash edd5e306176d, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

CONTRACT scanned grade A with 0 findings 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 yesterday.

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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

chdb/agents/CONTRACT.md · 233 lines

How it starts

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

chDB Agent Tool — cross-language contract

Status: beta / experimental (introduced in chdb 4.2.0). The surface may change in a minor release while it stabilizes across bindings; pin a version if you depend on it.

Contract version: 0.3.0 — exposed as CONTRACT_VERSION and via capabilities() in every binding. Downstream consumers probe capabilities instead of guessing from a package version (see Versioning & capabilities).

One behavior, many bindings. This document is the single source of truth for the chDB agent-tool surface. chdb.agents.ChDBTool (Python) is the reference implementation; the TypeScript binding (chdb-node) and any future language binding under chdb-io implement the same methods with the same semantics and are verified against the same fixture (conformance/cases.jsonl).

The goal is explicit: stop each language re-inventing query + introspection + safety with subtly different behavior. If a binding needs to diverge, it must add a case to the shared fixture documenting the divergence — not silently differ.

Methods (names are canonical; per-language casing may adapt)

Canonical tool name Purpose
run_select_query Run read SQL with bound params; return rows + truncation metadata
list_databases List databases
list_tables List tables in a database (current if omitted)
describe_table Columns/types of a table or a table-function expression
get_sample_data A few sample rows from a table or table function
list_functions List available SQL functions
attach_file Register a local file as a queryable named table (writable tools only)

Bindings expose these as native tools (Python methods on ChDBTool; TS chdbTools(); MCP tools in mcp-clickhouse) but the capability set, argument meaning, error classification, and safety guarantees are identical.

descriptors.json — the model-visible surface (single source)

descriptors.json (next to this file; vendored byte-identical in every binding) is the single source of truth for the model-visible surface: tool names, description text, and argument schemas. Everything the model reads is generated from it:

Read the full file on GitHub · 233 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. yesterday First seen · 233 lines · 0 tokens per session scan A edd5e306176d

Subscribe to this mod's changes

CONTRACT is an agent published in the GitHub repository chdb-io/chdb (2,885 stars, last pushed 4d ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 3,500 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other agents, from other repositories

buildkite-expert

Comprehensive Buildkite CI/CD expert for status checks, build introspection, and failure diagnosis. Handles everything from simple status queries to deep error analysis. Examples: Context: User wants to know the current build status. user: 'What's the status of my PR in Buildkite?' assistant: 'I'll use the…

dagster-io/dagster · 358 tokens

pr-update-expert

Expert agent for updating GitHub PRs through optimized AI workflow. Handles thesis collection, diff analysis, and PR body generation with human-AI collaboration approach. Examples: Context: User wants to update their PR with latest changes. user: '/aiupdatepr' assistant: 'I'll use the pr-update-expert agent to update…

dagster-io/dagster · 184 tokens

code-standards-enforcer

Use this agent when you need to audit changed files for compliance with coding standards defined in CLAUDE.md. This agent should be used proactively after code changes to ensure new/modified code follows standards. Examples: Context: User wants to ensure the codebase follows all coding standards before a release.…

dagster-io/dagster · 252 tokens

agent-coach

Use this agent when you want to analyze and improve agent performance after any agent invocation. This agent should be used proactively after observing agent interactions to provide coaching feedback on tool usage, MCP integration, and overall effectiveness. Examples: Context: User has just used a code-review agent to…

dagster-io/dagster · 213 tokens

data-jupyter-expert

Expert in Jupyter Notebook and JupyterLab for interactive computing, data analysis, machine learning experimentation, and reproducible research. Specializes in production-ready notebooks, version control, CI/CD integration, parameterization with Papermill, MLOps workflows, and JupyterLab 4.4+ modern features including…

andisab/swe-marketplace · 260 tokens

python-expert

Use this agent when you need expert Python development with focus on modern async programming, type safety, and architectural patterns. This agent specializes in FastAPI, Pydantic, SQLAlchemy 2.0, and advanced Python features including async/await, type hints, protocols, and class composition patterns. Examples…

andisab/swe-marketplace · 446 tokens