Skip to main content
Glama
platypus-db

platypus-db

Official

top_queries

Identifies the costliest SQL statements by total execution time from server statistics, returning calls, mean and max seconds, rows and users, with credentials and sensitive values masked.

Instructions

The statements that took the server most time, the costliest first, from its own statistics (pg_stat_statements, performance_schema, Query Store): the statement with its values replaced as the server writes them, calls, total, mean and max seconds, rows, user and database. 20 by default (limit, up to 100). Credentials and the values of sensitive columns are masked, long statements cut at 500 characters. PostgreSQL, MySQL, MariaDB and SQL Server; read-only. Says so when the statistics are not enabled (pg_stat_statements not installed) or the user may not read them.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "connection": "<connection>"
    },
    "name": "top_queries"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNoEntries returned at most: sessions for `server_activity` (50 by default, up to 200), statements for `top_queries` (20 by default, up to 100).
connectionYesThe connection's name, as `list_connections` shows it.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.6.2

TDQS

A3.9/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does well: it declares read-only behavior, masking of credentials and sensitive column values, truncation of long statements at 500 characters, and the graceful message when statistics are disabled or permissions are missing. It stops short of describing performance cost or latency of the collection itself.

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 return shape is front-loaded in the first sentence and operational caveats come last, so nothing is buried. The opening sentence is very long with stacked clauses, which slightly hurts scanability, but every clause adds information rather than filler.

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?

There is no output schema, and the description compensates by enumerating the returned fields (statement text, calls, total/mean/max seconds, rows, user, database) along with masking and truncation rules. Combined with the disabled-statistics caveat, an agent has enough to call and interpret it; only engine-specific variation in what those columns mean is left unstated.

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 coverage is 100%, so the schema already documents both's `connection` and `limit`. The description only restates the limit default and ceiling (20, up to 100), adding no syntax or format detail beyond what the schema provides; baseline 3 is appropriate.

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 resource and ordering: "The statements that took the server most time, the costliest first, from its own statistics," and names the concrete sources (pg_stat_statements, performance_schema, Query Store). This is enough to distinguish it from session-level siblings like server_activity without opening another 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?

Usage context is implied by "from its own statistics" and by the explicit statement that it reports when the statistics are not enabled or unreadable, which tells the agent when results may be empty. However, it never states when to prefer this over nearby alternatives (e.g., server_activity, search_history) or any exclusion criteria.

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