Skip to main content
Glama
dbeaver-mcp

dbeaver-mcp

by bnuprst

Explain a query plan

explain_query
Read-only

Displays a SQL query's execution plan so you can diagnose performance. Set analyze to run it read-only and rolled back, returning actual timings and PostgreSQL buffers.

Instructions

Shows the execution plan of a query. analyze=true really runs it (still read-only and rolled back) and reports actual times (and buffers on PostgreSQL).

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": {
      "connection": "<connection>",
      "sql": "<sql>"
    },
    "name": "explain_query"
  }
}

Input Schema

NameRequiredDescriptionDefault
sqlYesThe query to explain (without EXPLAIN).
paramsNo
analyzeNoExecute the query to get real timings. Default false.
connectionYesDBeaver connection name (as shown in DBeaver), its id, or project/name. See list_connections.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.4.1

TDQS

A4/5.0
Behavior5/5

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

The description adds crucial context beyond the readOnlyHint annotation: analyze=true actually executes the query, but it remains read-only and rolled back. It also discloses that actual times and PostgreSQL buffer information are reported, which is exactly the kind of behavioral nuance an agent needs to know when deciding whether to set analyze=true.

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, front-loaded with the primary purpose and immediately followed by the critical analyze=true caveat. Every clause carries useful information with no repetition or filler.

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?

For a four-parameter tool with no output schema, the description covers the core behavior and the most important edge case (analyze=true execution and rollback). It could say more about the shape of the returned plan, but the essential information needed to invoke it correctly is present.

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 75%, so the schema already documents most parameters. The description does add meaning for analyze=true (rollback, real timings, PostgreSQL buffers), but it says nothing about the params array or connection parameter, so it only partially compensates for the remaining coverage gap.

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?

States a specific verb and resource: 'Shows the execution plan of a query.' This clearly distinguishes it from run_query, but it does not explicitly name or contrast with any sibling tool, 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?

The description explains what analyze=true does, implying when to use it for real timings. However, it gives no explicit guidance on when to choose explain_query over run_query or other alternatives, and no exclusions or prerequisites are stated.

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