top_queries
Retrieve ranked PostgreSQL statements from pg_stat_statements by total time, mean time, calls, rows, or I/O to identify slow or high-load queries.
Instructions
[READ] Top statements from pg_stat_statements by a whitelisted metric.
Args:
order_by: One of total_time, mean_time, calls, rows, io.
limit: Number of statements to return (1..200, default 20).
target: Target name from config; omit for the default.
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": "top_queries"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| target | No | ||
| order_by | No | total_time |