# ClickHouse

ClickHouse is a fast open-source column-oriented database management system for real-time analytics and big data processing with SQL support

- **Category:** databases
- **Auth:** BASIC
- **Composio Managed App Available?** N/A
- **Tools:** 6
- **Triggers:** 0
- **Slug:** `CLICKHOUSE`
- **Version:** 20260223_00

## Tools

### Execute ClickHouse Query

**Slug:** `CLICKHOUSE_EXECUTE_QUERY`

Execute a SQL query in ClickHouse and return the results. This is the primary action for querying data from ClickHouse databases.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `query` | string | Yes | The SQL query to execute in ClickHouse |
| `format` | string | No | Output format for the query results. Common formats: JSONEachRow, JSON, CSV, TSV |
| `database` | string | No | Database to use for the query (overrides connection default) |
| `settings` | object | No | Additional ClickHouse settings for the query execution |
| `max_execution_time` | integer | No | Maximum query execution time in seconds |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Get Database Schema

**Slug:** `CLICKHOUSE_GET_DATABASE_SCHEMA`

Get comprehensive schema overview of an entire database including all tables and optionally their column definitions. Essential for AI agents to understand the complete database structure in a single call.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `database` | string | No | Database name (overrides connection default). If not specified, uses connection default or 'default' |
| `include_table_schemas` | boolean | No | Whether to include full column schemas for all tables. Set to false for quick overview, true for complete schema details. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Get ClickHouse Play Interface

**Slug:** `CLICKHOUSE_GET_PLAY_INTERFACE`

Get the ClickHouse Play web user interface for interactive query execution. Returns HTML page with Monaco Editor for writing queries and visualizing results.

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Get Table Schema

**Slug:** `CLICKHOUSE_GET_TABLE_SCHEMA`

Get detailed schema information for a specific table including column definitions, types, keys, and optionally sample data. This is essential for AI agents to understand table structure before constructing queries.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `database` | string | No | Database name (overrides connection default) |
| `table_name` | string | Yes | Name of the table to describe |
| `sample_rows` | integer | No | Number of sample rows to return (only if include_sample_data is true) |
| `include_sample_data` | boolean | No | Whether to include sample rows from the table |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### List ClickHouse Databases

**Slug:** `CLICKHOUSE_LIST_DATABASES`

List all databases in the ClickHouse instance. Useful for discovering available databases before querying tables.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `pattern` | string | No | Optional LIKE pattern to filter databases (e.g., 'prod_%' or '%test') |
| `include_tables` | boolean | No | Whether to include list of table names for each database |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### List ClickHouse Tables

**Slug:** `CLICKHOUSE_LIST_TABLES`

List tables in ClickHouse databases. Returns information about tables including their engine, size, and row count.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `pattern` | string | No | Optional LIKE pattern to filter table names (e.g., 'user_%' or '%_log') |
| `database` | string | No | Database name to list tables from. If not provided, lists tables from all databases |
| `include_views` | boolean | No | Whether to include views in the results |
| `include_columns` | boolean | No | Whether to include column names for each table |
| `include_primary_key` | boolean | No | Whether to include primary key information for each table |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |
