Skip to main content
Glama
cloudthinker-ai

Postgres MCP Pro Plus

get_top_queries

Identify and analyze slow or 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?

With no annotations provided, the description carries full burden but offers minimal behavioral disclosure. It mentions the data source but doesn't describe output format, whether results are real-time or historical, potential performance impact of running this tool, or authentication requirements. For a read operation with zero annotation coverage, this leaves significant gaps in understanding tool 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 with zero wasted words. It's front-loaded with the core purpose and includes essential contextual detail about the data source. Every element earns its place, making it immediately understandable without unnecessary elaboration.

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?

For a tool with no annotations and no output schema, the description is insufficiently complete. It doesn't explain what the output looks like (e.g., query text, metrics, timestamps), whether results are aggregated or raw, or how the tool handles different database states. Given the complexity of query performance analysis and lack of structured output documentation, more descriptive context is needed.

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 schema already fully documents both parameters. The description adds no additional parameter semantics beyond what's in the schema - it doesn't explain the practical difference between 'resources' versus time-based sorting, or how 'limit' interacts with different sort criteria. Baseline 3 is appropriate when schema does all the parameter documentation work.

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 specific action ('Reports') and target resource ('slowest or most resource-intensive queries'), with precise source attribution ('using data from the pg_stat_statements extension'). It effectively distinguishes this tool from siblings like get_blocking_queries or analyze_query_indexes by focusing on performance ranking rather than blocking analysis or index optimization.

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 context through 'slowest or most resource-intensive queries' and the pg_stat_statements data source, suggesting it's for performance monitoring. However, it doesn't explicitly state when to use this versus alternatives like analyze_db_health for broader health checks or get_blocking_queries for concurrency issues, nor does it mention prerequisites like needing the extension enabled.

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/cloudthinker-ai/postgres-mcp-pro-plus'

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