Skip to main content
Glama
itunified-io

mcp-postgres

by itunified-io

pg_query_explain

View a SQL query execution plan without executing, or run EXPLAIN ANALYZE for actual timing with confirmation.

Instructions

Run EXPLAIN on a query. mode=plan (default, safe) shows the plan without executing. mode=analyze executes the statement and shows actual timing — requires confirm=true.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYesSQL query to explain
modeNoExplain mode: plan (safe) or analyze (executes, requires confirm)plan
paramsNoJSON array of parameter values
targetYesTarget name from ~/.dbx/targets/
confirmNoSet to 'true' for mode=analyze (EXPLAIN ANALYZE executes the statement)
Behavior4/5

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

Without annotations, the description fully carries the burden. It discloses that plan mode does not execute (safe) and analyze mode actually executes the statement with timing, requiring confirm=true. It does not explicitly warn about potential mutations from analyze mode, but the confirm requirement acts as a safety gate.

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 extremely concise with two sentences. The first sentence states the core purpose, and the second explains the modes and safety condition. No unnecessary words, and critical information is front-loaded.

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?

Given no output schema, the description does not specify return format or structure, but the schema covers all input parameters. The description adequately explains behavioral differences between modes and the confirm requirement for analyze. For a tool with moderate complexity, it is fairly complete for usage decisions.

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 100%, so baseline is 3. The description adds limited value beyond the schema; it summarizes the modes and confirm requirement, but the schema already includes equivalent descriptions for mode and confirm. No additional parameter details are provided.

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 clearly states the tool runs EXPLAIN on a query, and distinguishes two modes (plan and analyze). It is specific about the verb ('Run EXPLAIN') and resource ('query'), and differentiates from sibling tools like pg_query (which executes).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear guidance on when to use each mode: plan is safe/default, analyze executes and requires confirm=true. It does not explicitly state when not to use the tool or mention alternatives like pg_query for execution, but the mode guidance is sufficient for selection.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/itunified-io/mcp-postgres'

If you have feedback or need assistance with the MCP directory API, please join our Discord server