execute_tql
Run PromQL-compatible TQL queries for time-series metric analysis; results are row- and byte-bounded with truncation notices.
Instructions
Execute TQL query for time-series analysis. TQL is PromQL-compatible.
Use it for metric tables, where the table name is the metric name and the
value columns are the PromQL fields. PromQL vector matching can combine
metrics from different tables. Use execute_sql for log or event rows,
trace analysis, and SQL JOINs.
`metric{__schema__="other_db"}` reads a database other than the connected
one. That matcher accepts `=` only.
Returns at most 10000 rows, also bounded by a byte budget. JSON reports
`truncated`; CSV and Markdown append a truncation notice. A shorter time
range or fewer series changes coverage; a larger step lowers resolution.
An untruncated retry with those changes does not cover the original query.
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": {
"query": "<query>",
"start": "<start>",
"end": "<end>",
"step": "<step>"
},
"name": "execute_tql"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| end | Yes | End time: SQL expression (e.g., 'now()'), RFC3339, or Unix timestamp | |
| step | Yes | Query resolution step, e.g., '1m', '5m', '1h' | |
| query | Yes | PromQL-compatible expression. Supports standard PromQL syntax: rate(), increase(), sum(), avg(), histogram_quantile(), etc. Example: rate(http_requests_total[5m]) | |
| start | Yes | Start time: SQL expression (e.g., "now() - interval '5' minute"), RFC3339 (e.g., '2024-01-01T00:00:00Z'), or Unix timestamp | |
| format | No | Output format: csv, json, or markdown (default: json) | json |
| lookback | No | Lookback delta: how far back a sample may be reused when a step lands where there is no sample, e.g. '5m'. Defaults to 5m. |