Skip to main content
Glama
shubham4038

postgres-mcp-js

by shubham4038

get_top_queries

Retrieve the slowest or most resource-intensive queries using pg_stat_statements, sorted by total time, mean time, or combined CPU and I/O usage.

Instructions

Report the slowest or most resource-intensive queries using pg_stat_statements.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo
sort_byNo"resources" = combined CPU + I/O; "total_time" = cumulative; "mean_time" = per executionresources
databaseNoDatabase alias to query. Omit to use the primary database.
Behavior2/5

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

No annotations are provided, so the description must convey behavioral traits. It only states the tool 'report the slowest or most resource-intensive queries' but fails to disclose whether it is a read-only operation, potential performance impact, required permissions, or output characteristics.

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?

The description is a single concise sentence that front-loads the action ('Report') and resource. However, the mention of 'using pg_stat_statements' is slightly redundant if the tool implicitly uses that view.

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?

Given the lack of an output schema and the complexity of the tool (three parameters, zero required), the description should provide context on output format or prerequisites (e.g., requiring pg_stat_statements extension). It does not meet this need.

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?

The input schema already describes 'sort_by' and 'database' with some detail, and 'limit' has constraints. The description adds no additional parameter meaning beyond what the schema provides, and with 67% schema coverage, it does not compensate for the lack of description on 'limit'.

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 uses a specific verb 'Report' and identifies the resource as 'slowest or most resource-intensive queries', sourced from 'pg_stat_statements'. This clearly distinguishes it from sibling tools like 'explain_query' or 'analyze_workload_indexes'.

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?

While the description implies usage for performance diagnostics, it does not explicitly state when to prefer this tool over alternatives (e.g., 'analyze_workload_indexes' for index-specific analysis) or when not to use it.

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/shubham4038/postgres-mcp-js'

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