query_logs
Query Grafana Loki to retrieve cwbe logs for debugging failed jobs or tracking progress. Filter by job ID, text, or custom LogQL.
Instructions
Query Grafana Loki for cwbe logs. Primary use: scrape
sourceAudioBlobName and translationsBlobName from a failed
/chapters/from-marks job for retry, or follow a job's progress
across phases.
Exactly one of job_id, filter_text, or logql should be given
(in that precedence). If none, returns all recent cwbe lines (noisy).
Args: job_id: Filter to lines containing this cwbe job UUID. filter_text: Filter to lines containing this literal substring (e.g. "from-marks", "blob=", "Google Translate raw response"). logql: Raw LogQL string, used verbatim. Caller handles escaping. minutes_back: Time window in minutes (default 30). limit: Max lines returned (default 500, newest-first).
Returns JSON {"count": N, "entries": [{"timestamp": "<ns>", "line": "..."}]}.
Requires grafana_user and grafana_password in ~/.cwmcp/config.properties.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| job_id | No | ||
| filter_text | No | ||
| logql | No | ||
| minutes_back | No | ||
| limit | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |