Stream Engine Statements
streamEngineStatementsRanks 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
| Name | Required | Description | Default |
|---|---|---|---|
| env | No | ||
| range | No | How far back to look; the answer has 30 to 96 points across it | 1h |
| region | No | ||
| appSlug | Yes | ||
| serviceName | Yes | ||
| workspaceSlug | Yes |