Skip to main content
Glama
Aguantar

io.github.Aguantar/clickhouse-dataops-mcp

by Aguantar

ch_explain_query

Analyze your ClickHouse query's execution plan to reveal partition pruning and sorting key usage, and receive targeted optimization suggestions for better performance.

Instructions

Analyze a query's execution plan and suggest optimizations.

Runs EXPLAIN PLAN and EXPLAIN PIPELINE, then provides structured analysis:

  • Whether partition pruning is active

  • Whether sorting keys are utilized

  • Specific optimization suggestions (add time filters, use pre-aggregated tables, etc.)

This is the key differentiator from generic ClickHouse tools — it doesn't just execute queries, it advises on how to write better ones.

Args: sql: The SELECT query to analyze database: Target database (default: cdc_pipeline)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYes
databaseNocdc_pipeline

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It describes the non-destructive analysis behavior (running explains) and enumerates specific outputs (partition pruning, sorting keys, suggestions). It does not mention prerequisites, rate limits, or error handling, but the tool is inherently safe.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description has a logical structure: a concise opening, a bullet list of analysis features, a differentiating statement, and an Args section. While the bullet list adds clarity, it could be more streamlined. Overall, it is efficient and front-loaded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description covers key outputs (partition pruning, sorting keys, optimization suggestions) for a tool of this complexity. The presence of an output schema reduces the need to explain return values. It omits failure scenarios but is otherwise complete for its intended use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage, the description compensates by explaining the 'sql' parameter as a SELECT query and 'database' with a default value and purpose ('cdc_pipeline'). This adds meaningful context beyond the schema's type and title.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool analyzes a query's execution plan and suggests optimizations. It explicitly mentions running EXPLAIN PLAN and EXPLAIN PIPELINE, and differentiates from generic tools by providing advisory rather than execution.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explains what the tool does and contrasts with generic ClickHouse tools, implying use for optimization. However, it does not explicitly state when to use it versus siblings like ch_query or ch_slow_queries, nor does it provide when-not-to-use guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Aguantar/clickhouse-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server