Skip to main content
Glama
abiswas97

Postgres MCP Server

by abiswas97

get_slow_queries

Identify slow PostgreSQL queries from pg_stat_statements, filter by duration or call count, and sort by total time, mean time, calls, or rows.

Instructions

Analyze slow queries via pg_stat_statements with filtering and sorting

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo
sort_byNo
min_callsNo
min_duration_msNo
include_query_textNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.0.0

TDQS

C2.7/5.0
Behavior2/5

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

No annotations are provided, so the description carries the full behavioral burden, yet it discloses almost nothing: not whether this is read-only, not whether the pg_stat_statements extension must be installed, and not what include_query_text implies for query text exposure or privacy. It only reveals the backing view.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

It is a single compact sentence with no filler, front-loading the resource and the data source. It is efficient, though it is arguably too terse for the breadth of undocumented options it must cover.

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

Completeness2/5

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

With five undocumented parameters, no output schema, and no annotations, the description is far too thin for the tool's complexity. An agent cannot tell what the results look like, how they are ordered by default, or whether the call requires prior diagnostics.

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% across five parameters, including a sort_by enum and numeric thresholds. The description's 'filtering and sorting' adds no meaning beyond the parameter names themselves, leaving min_calls, min_duration_ms, limit, and include_query_text entirely unexplained.

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?

The description names a specific resource (slow queries) and the data source (pg_stat_statements) plus activities (filtering and sorting), which is more than a tautology. However, it does not distinguish itself from sibling diagnostics tools like explain_query or diagnose_database, so an agent must infer the boundary.

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

Usage Guidelines2/5

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

The phrase 'with filtering and sorting' gestures at capability but gives no when-to-use context, no exclusions, and no mention of alternatives like explain_query for a specific statement. The agent gets no routing guidance among the nine sibling tools.

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