Skip to main content
Glama
Cloady

Cloady

Official
by Cloady

Stream Engine Statements

streamEngineStatements
Read-only

Ranks database statements by total time, calls, and average latency, returning normalized SQL text across Postgres, MySQL, MariaDB, ClickHouse, and MongoDB; supports live interval streaming.

Instructions

Returns the statements with the most time, the most calls and the slowest means, with their normalized text: pg_stat_statements on Postgres, performance_schema digests on MySQL and MariaDB, system.query_log over range on ClickHouse, per-collection totals on MongoDB. Statement text can carry data, so this needs the developer role. A one-shot read gives cumulative values; sending Accept: text/event-stream instead follows it live, a frame every fifteen seconds with calls and time over the interval.

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": {
      "workspaceSlug": "<workspaceSlug>",
      "appSlug": "<appSlug>",
      "serviceName": "<serviceName>"
    },
    "name": "streamEngineStatements"
  }
}

Input Schema

NameRequiredDescriptionDefault
envNo
rangeNoHow far back to look; the answer has 30 to 96 points across it1h
regionNo
appSlugYes
serviceNameYes
workspaceSlugYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.18.0

TDQS

A3.6/5.0
Behavior5/5

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

Beyond the readOnly/openWorld annotations, the description discloses the required developer role, warns that statement text can carry data, and explains a non-obvious protocol trait: a plain read yields cumulative values while `Accept: text/event-stream` switches to a live 15-second frame cadence reporting calls and time over the interval. Those are exactly the behavioral facts an agent cannot get from the schema or annotations.

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 core purpose is front-loaded, then engine sources, then permission, then streaming behavior — a sensible order with no filler sentences. The middle sentence is dense with engine names, which slightly taxes scanning, but every clause carries 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?

For a six-parameter, no-output-schema tool, the description covers what is returned (ranked statements with normalized text) and the cumulative-versus-interval distinction, which is genuinely helpful. It still leaves the five undocumented parameters unexplained and never states how many statements come back or whether `env` defaults, which an agent needs to call this reliably.

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 only 17% — `range` is the sole documented parameter, and the description merely echoes it (system.query_log over `range`, interval semantics) rather than adding meaning. It says nothing about env, region, serviceName, appSlug, or workspaceSlug, and no limit/row-count behavior for the returned statement list is given, so the description does not compensate for the coverage gap.

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?

"Returns the statements with the most time, the most calls and the slowest means, with their normalized text" gives a concrete verb, resource, and ranking criterion. It also clarifies that data comes from per-engine sources (pg_stat_statements, performance_schema digests, system.query_log, MongoDB collection totals). It falls short of a 5 because it never distinguishes itself from the near-identically named sibling streamEngineStats or from explainEngineStatement.

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 the ranking language and the streaming note, and the developer-role requirement is stated, which is useful for access decisions. But there is no explicit guidance on when to pick this over streamEngineStats, explainEngineStatement, or readEngineSlowLog, and no statement of when the one-shot versus SSE mode is appropriate.

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

Deploy Server

Other Tools