Skip to main content
Glama
DB Health MCP
by ekss1121

slow_queries

Find slow database queries by mean execution time on MySQL and PostgreSQL; get steps to enable required statistics when unavailable.

Instructions

List the slowest queries by mean execution time (MySQL: performance_schema statement digests; PostgreSQL: pg_stat_statements). If the statistics source is unavailable, returns instructions for enabling it instead of failing.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "slow_queries"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNo
database_urlNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.1

TDQS

A3.6/5.0
Behavior3/5

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

With no annotations, the description must carry the full behavioral burden. It does disclose one valuable non-obvious trait: graceful degradation, returning enablement instructions rather than failing when the statistics source is unavailable. It omits other relevant traits such as whether the call is read-only, connection/permission requirements, or sampling/aggregation caveats.

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?

Two sentences, zero filler, with the core purpose front-loaded and the fallback behavior as a secondary clause. Every sentence earns its place.

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?

There is no output schema, so the description usefully characterizes the return (a ranked list of slow statements, or enablement instructions). But for a tool with two undocumented parameters and no annotations, the definition leaves gaps around parameter behavior and result limits that an agent would need when invoking it.

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?

Schema description coverage is 0% across two parameters, so the description must compensate and does not. Neither the meaning of "limit" (how results are truncated or ordered) nor "database_url" (including what happens when it is null, presumably falling back to a configured connection) is addressed.

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?

States a specific verb and resource ("List the slowest queries") plus the ordering metric (mean execution time), and even names the underlying statistics source per engine. This is clearly distinguishable from siblings like index_usage, table_bloat, or health_report without opening any schema.

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 diagnostic intent is implied by "slowest queries by mean execution time," so an agent can infer performance-triage usage. However, there is no explicit statement of when to prefer this over health_report or missing_indexes, and no stated prerequisites (e.g., that statement statistics must be collected).

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.