Skip to main content
Glama
Intelligent Database DBA & Schema Migration Guardrail MCP Server

Intelligent Database DBA & Schema Migration Guardrail MCP Server

explain_query_plan

Analyzes SQL query plans to flag full table scans, missing indexes, and high-cost operations, helping you diagnose slow queries before tuning or migration.

Instructions

Executes EXPLAIN QUERY PLAN on a SQL query and flags FULL TABLE SCANs, missing indexes, and high-cost operations.

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": {
      "sqlQuery": "<sqlQuery>"
    },
    "name": "explain_query_plan"
  }
}

Input Schema

NameRequiredDescriptionDefault
sqlQueryYesThe SQL SELECT query to analyze
tableNameNoOptional: specific table to focus analysis on

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.5/5.0
Behavior3/5

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

No annotations are supplied, so the description carries the full burden. It usefully discloses what the tool surfaces in its analysis (full scans, missing indexes, costly operations), but it never clarifies whether the supplied SQL query is actually executed or only planned, nor does it state safety, side effects, or database dialect — a material gap for a tool that takes arbitrary SQL.

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?

A single dense sentence with the operation front-loaded and the diagnostic outputs enumerated. Nothing is redundant and every clause earns its place.

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 annotations and no output schema, the description must stand alone, and it leaves out whether the query executes, what the returned plan/flag format looks like, and any limits on query type. It is adequate for a two-parameter read-style tool but not complete.

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% and both parameters (sqlQuery, tableName) are documented in schema, so the baseline of 3 applies. The description adds no further meaning about scope, query constraints, or how tableName narrows the analysis.

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 method ("Executes EXPLAIN QUERY PLAN") plus the resource (a SQL query) and the diagnostic categories it reports (FULL TABLE SCANs, missing indexes, high-cost operations). An agent can distinguish it from siblings like suggest_optimal_indexes, though the description never names an alternative to sharpen that boundary.

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: you would use it to diagnose a slow or suspect query. It gives no explicit when-to-use or when-not-to-use versus dry_run_migration or suggest_optimal_indexes, so the agent must infer the routing from the tool's output categories.

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