Skip to main content
Glama
dbadmin-mcp

dbadmin-mcp

by legavaz

explain

Generates PostgreSQL query execution plans with ANALYZE and BUFFERS for SELECT statements in a read-only transaction to diagnose query performance.

Instructions

План запроса PostgreSQL: EXPLAIN (ANALYZE, BUFFERS) для SELECT, в read-only транзакции.

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": "explain"
  }
}

Input Schema

NameRequiredDescriptionDefault
sqlYes
analyzeNoвыполнять запрос (по умолчанию да)
connectionNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

B3.1/5.0
Behavior3/5

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

With no annotations, the description carries the full burden; it usefully discloses that execution happens inside a read-only transaction and that BUFFERS data is included. However, it never warns that ANALYZE actually executes the query (potentially expensive/long-running) nor describes the returned plan format or any cost/row limit.

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?

A single compact sentence with the key identifiers (EXPLAIN, ANALYZE, BUFFERS, SELECT, read-only) front-loaded. Efficient, though it omits rather than wastes words.

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

Completeness2/5

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

For a three-parameter tool with no annotations and no output schema, the description should explain the result shape (plan text/format) and the execution-risk of ANALYZE; it does neither, and leaves `connection` and analyze=false behavior opaque.

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

Parameters2/5

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

Schema coverage is only 33%: only `analyze` is documented in the schema, and `connection` is unexplained in both schema and description. The description gestures at ANALYZE behavior but does not explain the effect or cost of setting analyze true vs false, nor what `connection` selects.

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

Purpose4/5

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

The description names a specific operation and output (a PostgreSQL query plan via EXPLAIN (ANALYZE, BUFFERS)) scoped to SELECT, which distinguishes it from a row-returning tool like run_select. It does not explicitly name any sibling as the alternative, so it falls short of a 5.

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

Usage Guidelines3/5

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

Usage is implied (call it to inspect a SELECT's plan) and the read-only framing suggests safety, but there is no explicit when-to-use/when-not guidance and no routing to alternatives such as run_select or slow_queries.

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