Skip to main content
Glama
Teja-sudo

postgres-mcp-server

by Teja-sudo

get_top_queries

Retrieve the slowest PostgreSQL queries using pg_stat_statements to identify performance bottlenecks and optimize database efficiency.

Instructions

Find slowest queries from pg_stat_statements. Requires pg_stat_statements extension enabled. Use this to identify performance bottlenecks.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoNumber of queries to return (1-100)
orderByNoSort by total time, average time, or call counttotal_time
minCallsNoMinimum call count to include
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It discloses a critical prerequisite ('Requires pg_stat_statements extension enabled'), which aids safe usage. However, it does not explicitly state whether the tool is read-only (though implied) or describe any side effects or output structure. This leaves some behavioral ambiguity.

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 (two sentences) and front-loaded: first sentence states the action, second adds a requirement and use case. Every word earns its place with no redundancy.

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 tool has 3 parameters and no annotations or output schema. The description covers the prerequisite and high-level purpose but does not describe the return values (e.g., columns returned, pagination). For a diagnostic tool, this gap could affect an agent's ability to interpret results 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?

Schema coverage is 100%, so the input schema adequately documents each parameter (limit, orderBy, minCalls). The description does not add additional parameter-level meaning beyond the schema (e.g., it doesn't explain what 'total_time' means). Baseline 3 is appropriate since the schema is self-sufficient.

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's function: 'Find slowest queries from pg_stat_statements.' It uses a specific verb ('find') and resource ('slowest queries'), and the context 'identify performance bottlenecks' distinguishes it from sibling tools like analyze_query_indexes or find_blocking_queries.

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 gives a clear usage context: 'Use this to identify performance bottlenecks.' However, it does not explicitly state when not to use this tool or suggest alternatives from the sibling list. The instruction is helpful but lacks exclusion guidance, which would improve decision-making.

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/Teja-sudo/postgres-mcp-server'

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