Skip to main content
Glama

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

TableJSON Schema
NameRequiredDescriptionDefault
job_idNo
filter_textNo
logqlNo
minutes_backNo
limitNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, but the description specifies prerequisites (credentials in config file), return format, and default parameters. It could mention that it's a read-only operation, but the query nature implies that. No contradictions.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured: purpose, use case, parameter rules, then list, return format, requirements. It is slightly verbose but every sentence adds value; minor trimming possible.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of a log query tool, the description covers everything: purpose, parameters, return format (with sample JSON), and authentication requirements. Output schema is not provided, but description compensates. Complete tool understanding.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 0% description coverage (only titles), but the description explains each parameter in detail: job_id, filter_text, logql (with usage note), minutes_back, and limit. It adds meaning beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states 'Query Grafana Loki for cwbe logs' and specifies two primary use cases: scraping blob names for retry and following job progress. This differentiates it from sibling tools, which are all distinct (e.g., align, segment).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly says when to use (for retry or progress tracking) and provides a precedence rule: exactly one of job_id, filter_text, or logql. It warns that none is noisy, giving clear usage boundaries.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/paulmichaelstafford/cwmcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server