ch_query
Run read-only SELECT queries on ClickHouse with automatic safety checks, LIMIT enforcement, and partition pruning analysis to optimize performance.
Instructions
Execute a read-only SQL query against ClickHouse.
Runs SELECT queries with automatic safety validation (DDL/DML blocked), LIMIT enforcement, and partition pruning analysis. Returns results with a warning if the query doesn't leverage partitioning efficiently.
Args: sql: SELECT query to execute database: Target database (default: cdc_pipeline) max_rows: Maximum rows to return (default: 1000, max: 10000)
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"sql": "<sql>"
},
"name": "ch_query"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | ||
| database | No | cdc_pipeline | |
| max_rows | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |