search_logs
Search Grafana Loki logs with LogQL queries and a chosen time range to find matching entries; limit results and return Markdown or JSON.
Instructions
Search Grafana Loki logs using LogQL query language. Returns log entries matching the query within the specified time range.
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": "search_logs"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| hours | No | Hours to search back from now (default: 1) | |
| limit | No | Maximum number of log lines to return (default: 100) | |
| query | Yes | LogQL query string (e.g., '{app="web"} |= "error"') | |
| response_format | No | Response format (default: markdown) | markdown |