Skip to main content
Glama

db_top_queries

Show the slowest or heaviest queries for a database instance using performance_schema or pg_stat_statements. Read-only tool for troubleshooting query performance.

Instructions

Show the slowest / heaviest queries for an instance's DB. MySQL: performance_schema digest summary. Postgres: pg_stat_statements (extension must be enabled). For the shared-RDS noisy-neighbour case. Requires a db_profile; password from your secret store. Read-only query.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
instance_idYesInstance ID, name, or custom-server name.
limitNoHow many queries to return (1–100, default 15).
Behavior4/5

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

With no annotations, the description carries full burden. It discloses that the operation is read-only and requires specific database extensions (Postgres) and configuration (MySQL). It also mentions the need for credentials from a secret store.

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 concise with four sentences. It front-loads the purpose, then provides engine details, a use case, and a prerequisite. Every sentence adds value without redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with 2 simple parameters and no output schema, the description adequately covers prerequisites, engine behavior, and read-only nature. It could specify output format (e.g., query text with metrics) but this is not critical for tool selection.

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 explains both parameters. The description does not add significant new meaning beyond what the schema provides, apart from implying that 'limit' controls the number of returned queries.

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 'Show the slowest / heaviest queries for an instance's DB.' It distinguishes itself from sibling tools like db_processlist by focusing on query performance analysis and specifies engine-specific implementations.

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 provides explicit context: it's for the 'shared-RDS noisy-neighbour case' and requires a db_profile and password. It also notes engine-specific prerequisites. However, it does not explicitly state when not to use this tool or suggest alternatives.

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/zb-ss/servonaut'

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