Tools
Query parameters
Values go in ClickHouse’s own parameter syntax,{name:Type}, and the agent passes them in params. They are sent to the server separately from the SQL text, never pasted into it:
params {"service": "checkout", "since": "2026-09-26 00:00:00"}.
Safety
- Read-only by default, enforced by ClickHouse. Every read is sent with
readonly = 1(or, for a user whose profile is already read-only, runs under that profile), so the server refuses anINSERT,ALTERorDROPon that request (error 164) whatever the user’s grants. Run Query also refuses before sending anything: comments, a second statement, write keywords, andSETTINGSorFORMATclauses that would change the limits. - Limits on every call.
max_execution_timedefaults to 15 s (up to 55 s withtimeout_seconds).max_result_rowswithresult_overflow_mode = breakstops the server at 500 rows (up to 5,000 withmax_rows); Danube stops reading at the same cap and the response is limited to 1 MB. A cut result hastruncated: true. 64-bit integers come back as numbers. - Writes are a separate tool. Execute Statement only runs on a connection stored with mode
read_write, and every call returns aconfirm_tokenfirst that the agent must show you and send back. - No secrets in results. The password travels in a request header, never in the URL, and is removed from every error message. Redirects are not followed.
- Every call is audited. The audit log records who called, which tool, a SHA-256 of the SQL (never the text), the row count, the duration and the outcome.
Create a read-only user
Run this as an admin (on ClickHouse Cloud, in the SQL console asdefault):
GRANT SELECT line for every database agents should see. readonly = 2 makes the user read-only for data and schema while still letting Danube set the per-query time and row limits. With readonly = 1 the user is read-only too, but ClickHouse then refuses every setting, including those limits: Danube still caps rows and times out on its side, and Test Connection warns about it.
Connect
Open ClickHouse in the dashboard’s tool catalog and click Connect, or let the agent callstore_credential. Fill in the URL (for ClickHouse Cloud, the HTTPS endpoint from Connect in the Cloud console, ending in :8443), user, password and default database. Mode stays Read only unless you want Execute Statement to work. Paste a CA certificate only for a self-hosted server with a private certificate.
How Danube reaches ClickHouse depends on where it runs:
- Public endpoint
- Private network, SSH bastion
- Private network, data-plane agent
ClickHouse Cloud services and self-hosted servers with a public HTTPS endpoint connect directly. Allow Danube’s egress addresses in the service’s IP access list (ClickHouse Cloud: Settings then Security): see Connect your production database safely.
auth_required), the network (connection_error, destination_blocked) or TLS (tls_error).
Example prompts
- “Which tables in ClickHouse are biggest, and how are they sorted?”
- “How many error events did the checkout service log per hour today?”
- “Which queries in the last hour took longer than five seconds, and how many rows did they read?”
- “Show me the queries that failed in the last 30 minutes and group them by exception.”
- “Describe the
eventstable and tell me which filters will use its sorting key.”
