Skip to main content
Glama
jovian-zhibai

mcp-database

explain_query

Reveals the execution plan for a SELECT query, showing how the database will run it to help identify performance bottlenecks.

Instructions

Explain the execution plan for a SELECT query.

Args: query: SQL SELECT or WITH...SELECT statement to explain. connection_name: Name of the database connection (default: "default").

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes
connection_nameNodefault

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

A3.7/5.0
Behavior2/5

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

With no annotations, the description carries the full burden of disclosing behavior, yet it only states what the tool does and not its side effects or constraints. It does not disclose whether the query is actually executed, whether the operation is read-only, or how the returned plan is presented. It adds no behavioral context beyond the bare purpose.

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?

The description is compact: one sentence for the main purpose plus a concise Args list. It front-loads the core purpose, and every line adds relevant information about the tool or its parameters with no redundancy.

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?

The tool is simple, with two documented parameters and an output schema to cover return values, so the description covers the essentials. However, it omits usage guidance (when to prefer this over execute or query) and behavioral safety (whether it executes the query or modifies state), which an agent needs to select and invoke the tool correctly in the absence of annotations.

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?

Schema description coverage is 0%, so the description is the only documentation available. It clearly states that query must be a SELECT or WITH...SELECT statement and defines connection_name as the name of the database connection with a default. This adds meaning the schema alone lacks, though it could be richer by referencing how valid connection names are obtained.

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 states a specific verb ('Explain'), a specific resource ('execution plan'), and a specific input class ('SELECT query'). This clearly distinguishes it from sibling tools like query and execute, which run queries rather than analyze their plans.

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 implies its use case—when you need to understand a query's execution plan—and confines input to SELECT/WITH...SELECT. However, it offers no explicit guidance on when not to use it, nor does it name alternatives such as using query or execute to actually run the statement.

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