Skip to main content
Glama

Postgres Explain

postgres_explain

Generate a Postgres EXPLAIN plan for a SELECT without executing it, enabling query performance analysis with no side effects. Use to diagnose slow queries safely.

Instructions

EXPLAIN (FORMAT TEXT) a SELECT without ANALYZE / executing side effects.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYes
paramsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4/5.0
Behavior4/5

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

With no annotations provided, the description carries the behavioral disclosure burden and does state the key trait: it runs EXPLAIN without ANALYZE and without executing side effects. It omits details like connection/auth, but the safety-critical distinction is present.

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 a single front-loaded sentence with no filler. Every phrase contributes: the command variant, the query type, and the no-execution guarantee.

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 core behavior and no-side-effect guarantee are clear, and an output schema covers return values. However, because the schema has zero property descriptions, the optional params field is left completely unexplained, leaving a real completeness gap for a tool with two parameters.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must explain both parameters. It only implies that sql holds a SELECT statement and says nothing about params, such as whether params supplies bind values for placeholders like $1 or how they are passed. This is a significant gap.

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 names a specific operation (EXPLAIN with FORMAT TEXT) and the target resource (a SELECT). It also differentiates itself from executing the query by explicitly noting no ANALYZE / executing side effects, so an agent can distinguish it from postgres_query_readonly.

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 'without ANALYZE / executing side effects' phrase gives clear context that this tool is for obtaining query plans rather than running the query. It does not explicitly name postgres_query_readonly as the execution alternative or list exclusions, but the intended use is evident.

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