Skip to main content
Glama

explain_query

Read-onlyIdempotent

Runs EXPLAIN on a SELECT query using a specified DBeaver connection and database to reveal execution plans and help diagnose query performance.

Instructions

Runs EXPLAIN on a SELECT query using the specified DBeaver connection + database.

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_query"
  }
}

Input Schema

NameRequiredDescriptionDefault
sqlYes
databaseNoTarget database/schema name on that connection.
connectionNoDBeaver connection name or host (e.g. 'localhost', 'staging-db'). Defaults to default_connection.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

B3.4/5.0
Behavior3/5

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

Annotations already declare readOnlyHint, idempotentHint, destructiveHint=false and openWorldHint=false, so the safety profile is covered. The description adds the useful constraints that only SELECT statements are supported and that a specific connection is targeted, but it doesn't say whether the statement is actually executed or what the plan output looks like.

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 front-loaded sentence with no wasted wording. It could be tightened slightly ('Runs EXPLAIN on a SELECT query' plus target), but nothing is redundant.

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?

With no output schema, the description should indicate what the tool returns (the EXPLAIN plan, in some text/structured form) and whether the query is executed. Those omissions leave a moderate gap for a three-parameter tool whose annotations already cover safety.

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 67%, with database and connection already documented in the schema. The description only reiterates the connection/database pairing and adds the meaningful 'SELECT' restriction for the undocumented sql parameter, leaving slightly more to be desired at this coverage level.

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+resource: 'Runs EXPLAIN on a SELECT query' and names the required DBeaver connection and database context. It is clear what the tool does, but it never contrasts itself with the closely named sibling diagnose_query, so an agent must infer the difference.

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 only implied: the tool applies to SELECT queries and requires a connection/database target. There is no explicit statement of when to prefer this over diagnose_query or when not to use it, and no prerequisites such as needing an active DBeaver connection.

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