loki_tail_errors
Fetch error-level log lines for a Loki stream selector over a chosen lookback window to troubleshoot incidents, with limits and truncation status.
Instructions
[READ] Canned error-level read for a stream selector (error line-filter).
Args: selector: A Loki stream selector (e.g. '{app="api"}' or 'app="api"'). hours: Lookback window in hours (capped at the tool's max lookback). limit: Max log lines to return (clamped to the tool's max line limit). target: Loki target name from config; omit for the default.
Returns an envelope with returned/limit/truncated. If
truncated is true the result is partial — re-run with a higher limit.
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": {
"selector": "<selector>"
},
"name": "loki_tail_errors"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| hours | No | ||
| limit | No | ||
| target | No | ||
| selector | Yes |