logs_query
Query Loki logs using LogQL to retrieve matching log lines for troubleshooting and observability investigations.
Instructions
Query logs from Loki using LogQL. Returns log lines matching the 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>"
},
"name": "logs_query"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| end | No | End time. Defaults to now. | |
| limit | No | Maximum log lines to return | |
| query | Yes | LogQL query (e.g. {app="my-api"} |= "error") | |
| start | No | Start time (ISO 8601 or Unix nanoseconds). Defaults to 1h ago. | |
| target | No | Named backend instance to query (configured: default). Defaults to the primary. | |
| direction | No | Sort order | backward |