Skip to main content
Glama

get_top_queries

Identify slow or resource-heavy PostgreSQL queries from pg_stat_statements. Sort by resource usage, mean time, or total time to pinpoint performance bottlenecks.

Instructions

Slow or resource-heavy queries from pg_stat_statements

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dbNoDatabase id from list_databases
limitNo
sort_byNoresources
Behavior2/5

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

With no annotations, the description carries the disclosure burden but only states the data source and a filtering hint. It does not mention sorting, defaults, permissions, or output format, leaving significant behavioral uncertainty.

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 concise sentence that front-loads the core purpose without redundancy. It earns its place with no wasted words.

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 3 parameters and no output schema, this minimal description is incomplete. It omits return values, default behaviors, and use context, making it hard for an agent to fully understand the tool's operation.

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 schema describes only 'db' (33% coverage). The description does not elaborate on 'limit' or 'sort_by', and it does not clarify how 'resources' sorting relates to 'slow or resource-heavy' queries. The description adds no parameter-level meaning beyond the schema.

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 identifies the resource (pg_stat_statements) and the subject (slow or resource-heavy queries), making the tool's target clear. However, it lacks an explicit verb like 'retrieve' or 'list', relying on the tool name to imply the action.

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?

No guidance is provided on when to use this tool versus alternatives like analyze_workload_indexes or explain_query. There is no mention of use cases, exclusions, or prerequisites.

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/Leon-Achteresch/postgres-mcp'

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