Skip to main content
Glama
BACH-AI-Tools

Postgres MCP Pro

get_top_queries

Identify and analyze the slowest or most resource-intensive PostgreSQL queries using pg_stat_statements data to optimize database performance.

Instructions

Reports the slowest or most resource-intensive queries using data from the 'pg_stat_statements' extension.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sort_byNoRanking criteria: 'total_time' for total execution time or 'mean_time' for mean execution time per call, or 'resources' for resource-intensive queriesresources
limitNoNumber of queries to return when ranking based on mean_time or total_time
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 burden of behavioral disclosure. It mentions the data source ('pg_stat_statements') but doesn't cover critical aspects like whether this is a read-only operation, potential performance impact, authentication needs, rate limits, or output format. For a tool reporting on database queries without annotations, this leaves significant gaps in understanding its behavior.

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, efficient sentence that directly states the tool's purpose without unnecessary words. It's front-loaded with the core action and resource, making it easy to parse. Every part of the sentence contributes essential information, earning its place.

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?

Given the tool's moderate complexity (2 parameters, no output schema, no annotations), the description is minimally adequate. It covers the purpose and data source but lacks details on behavioral traits, usage context, and output. Without annotations or an output schema, the agent has incomplete information to use the tool effectively, though the purpose is clear.

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 description coverage is 100%, so the input schema fully documents both parameters ('sort_by' and 'limit') with descriptions and defaults. The description adds no additional parameter semantics beyond what's in the schema, such as clarifying the 'resources' option or interaction effects. This meets the baseline of 3 when the schema handles parameter documentation effectively.

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 clearly states the tool's purpose: 'Reports the slowest or most resource-intensive queries using data from the 'pg_stat_statements' extension.' It specifies the verb ('reports') and resource ('queries'), and mentions the data source. However, it doesn't explicitly differentiate from sibling tools like 'analyze_db_health' or 'explain_query', which might also involve query analysis, so it falls short of a perfect 5.

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 description provides no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools like 'analyze_query_indexes' or 'explain_query', nor does it specify prerequisites or contexts for usage. The agent must infer usage from the purpose alone, which is insufficient for clear 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/BACH-AI-Tools/bach--postgres-mcp'

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