Skip to main content
Glama
lordbasilaiassistant-sudo

mcp-postgres-query

explain_query

Explain a SQL query's execution plan without modifying data. Runs EXPLAIN ANALYZE in a rolled-back transaction to reveal performance bottlenecks.

Instructions

Get the EXPLAIN ANALYZE execution plan for a SQL query. The query runs inside a transaction that is always rolled back, so it never modifies data.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYesSQL query to explain
Behavior4/5

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

With no annotations, the description carries the burden. It discloses a key behavioral trait: the query runs inside a transaction that always rolls back, ensuring no data modification. This adds safety context beyond simply 'explain'. However, it does not mention that EXPLAIN ANALYZE actually executes the query, which could have performance implications, nor any permission requirements.

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 two sentences with no filler. It front-loads the purpose and then adds a behavioral safety note. Every sentence earns its place.

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 a simple one-parameter tool with no annotations or output schema, the description covers the essential purpose and the critical safety guarantee. However, it does not describe the format of the returned execution plan or note that the query is actually executed (which might matter for planning). Still, it is adequate for an agent to select and invoke the tool 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?

The input schema already describes the sole parameter (sql) as 'SQL query to explain' with 100% coverage. The description reinforces the purpose but adds no new parameter-specific details such as syntax constraints or how the query string is processed. Therefore, it hovers at the baseline.

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 retrieves the EXPLAIN ANALYZE execution plan for a SQL query, which distinguishes it from sibling tools like query (executing queries) and list_tables/describe_table (schema introspection). The verb 'Get' and specific resource 'EXPLAIN ANALYZE execution plan' make the purpose explicit.

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 usage for analyzing execution plans but does not explicitly state when to prefer this over sibling tools like query, nor does it mention alternatives or exclusions. The rollback note provides context that it is safe for read-only analysis, but there is no direct guidance on when to use it versus other tools.

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/lordbasilaiassistant-sudo/mcp-postgres-query'

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