Skip to main content
Glama
nandanosql

database-explorer-mcp

by nandanosql

explain_query

Retrieve the execution plan for a SQL or MongoDB query without running it. Use it to optimize slow queries.

Instructions

Get the execution plan for a query without running it. Useful for optimizing slow queries.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSQL query or MongoDB JSON query to explain
connectionNoConnection alias (default: 'default')

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.1.0

TDQS

A3.6/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, and it does disclose the key trait that the query is not executed (safe, non-mutating). However it says nothing about permissions, the format of the returned plan, or how plan shape varies by connection type (SQL vs MongoDB).

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 short sentences with zero waste; the non-execution constraint and the use case are front-loaded, so the agent gets the essential fact immediately.

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 simple two-parameter read-style tool with no output schema, the description covers purpose and the critical non-execution behavior. It is slightly thin on what the returned plan contains, but an agent has enough to call it correctly.

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 description coverage is 100% for both parameters, so the schema already explains 'query' and 'connection'. The description adds no syntax or format detail beyond what the schema provides, so the baseline of 3 is appropriate.

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 (get execution plan) and resource (query), and the qualifier 'without running it' cleanly separates it from the sibling run_query. It does not name the sibling explicitly, but the scope is unambiguous.

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?

'Useful for optimizing slow queries' implies the usage context but gives no explicit when-to-use vs when-not, and never names run_query as the alternative for actual execution. The routing signal is inferable but not stated.

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