Skip to main content
Glama
Nam088

mcp-server-db

by Nam088

pg_get_top_queries

Retrieve the slowest SQL queries by execution time from pg_stat_statements to identify performance bottlenecks.

Instructions

Get the slowest SQL queries based on execution time from pg_stat_statements (if the extension is enabled).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum number of slow queries to return.
connectionIdNoId of the postgres connection to use, from databases.config.yml. Optional when only one postgres connection is configured.
Behavior3/5

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

No annotations are provided, so the description must disclose behavior. It states the data source and condition but does not explicitly mention that the operation is read-only or non-destructive. The behavioral disclosure is adequate but not complete.

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 sentence of 17 words, with the key action 'Get the slowest SQL queries' placed first. Every word adds value, and there is no unnecessary information.

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 simple nature of the tool (a read query with optional parameters) and no output schema, the description provides the core purpose and condition. However, it does not explain what the returned data includes (e.g., columns like query, execution time, calls), leaving some ambiguity about the output format.

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?

The input schema already provides descriptions for both parameters, covering 100% of schema properties. The tool description adds no additional parameter-level detail beyond what is in the schema, so it meets the baseline but does not exceed it.

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 verb 'Get' and resource 'the slowest SQL queries', specifies the source 'from pg_stat_statements', and conditions 'if the extension is enabled'. This distinguishes it from sibling tools like pg_active_queries or pg_long_running_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 includes a prerequisite ('if the extension is enabled'), which provides clear context for when the tool is usable. However, it does not explicitly contrast with alternatives or state when not to use it, so it falls short of a 5.

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/Nam088/mcp-database-server-v2'

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