Skip to main content
Glama
Dmitriusan

mcp-db-analyzer

by Dmitriusan

explain_query

Analyze a SQL query's execution plan with cost estimates and optimization warnings. Optionally run ANALYZE for actual execution statistics on read-only queries.

Instructions

Run EXPLAIN on a SQL query and return a formatted plan with cost estimates, node types, and optimization warnings. Optionally runs EXPLAIN ANALYZE for actual execution statistics (read-only queries only).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYesThe SQL query to explain
analyzeNoRun EXPLAIN ANALYZE to get actual execution times (executes the query). Only allowed for SELECT queries.
timeout_msNoConnection timeout in milliseconds (default: 30000). Increase for slow or remote databases.
Behavior3/5

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

With no annotations, the description must cover behavioral traits. It correctly notes that ANALYZE executes the query and is only allowed for SELECT queries. However, it does not disclose potential performance impact, resource consumption, or permissions needed, which are important for a SQL execution tool.

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

Conciseness5/5

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

Two sentences efficiently convey the core purpose and key optional behavior. No unnecessary words or repetition. Front-loaded with the primary action.

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

Completeness3/5

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

Given no output schema and 3 parameters, the description covers the main functionality but lacks details on the return format, timeout configuration (beyond default), and potential pitfalls. It is adequate but not comprehensive.

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

Parameters3/5

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

Schema coverage is 100%, so the baseline is 3. The description adds context about output (formatted plan types), but does not enrich parameter meaning beyond what the schema already provides.

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?

Description clearly states the tool explains a SQL query with a formatted plan including cost estimates, node types, and optimization warnings. It distinctly sets the tool apart from siblings like analyze_slow_queries or suggest_missing_indexes by focusing on a single query execution plan.

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 provides clear context for use: running EXPLAIN on a SQL query, with an optional EXPLAIN ANALYZE for actual stats, restricted to read-only queries. It implicitly guides when to use the analyze flag, but does not explicitly contrast with sibling tools or mention when not to use it.

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/Dmitriusan/mcp-db-analyzer'

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