Skip to main content
Glama
eric-patton

postgres-schema-mcp

by eric-patton

Explain query

explain_query
Read-onlyIdempotent

Show a SELECT query's execution plan without running it, then use analyze for measured timings to identify performance bottlenecks before executing on large tables.

Instructions

Show the query plan for a SELECT without running it. Pass analyze: true to execute it and get measured timings instead of estimates. Use this to tune a query before running it against a large table.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYesA single SELECT or WITH statement.
analyzeNoRun the query to collect real timings. Off by default.

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observedv0.1.1

TDQS

A4.5/5.0
Behavior4/5

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

Annotations declare readOnly and idempotent, and the description adds the key behavioral nuance that analyze: true executes the statement and returns measured timings instead of estimates. This is useful context beyond the structured annotations.

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?

Three short sentences with no filler: primary behavior, parameter behavior, and usage guidance are each given one sentence in logical order.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a two-parameter tool with rich annotations, the description says everything needed to select and use it: default plan-only behavior, analyze=true behavior, and the intended use case. No output schema is required; 'query plan' sufficiently describes the result.

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

Parameters4/5

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

Schema coverage is 100%, so the schema already documents both parameters. The description adds value by explaining that analyze toggles between estimates and measured timings and reinforces that sql must be a SELECT or WITH statement.

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?

States a specific verb and resource: show the query plan for a SELECT, and clarifies that the default does not run it. The 'tune before running' phrasing differentiates it from running actual queries via siblings like run_select.

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?

Gives actionable usage context: use it to tune a query before running it against a large table. It does not explicitly name run_select as the alternative or state when not to use it, so it falls just short of a 5.

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

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/eric-patton/postgres-schema-mcp'

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