Skip to main content
Glama
AIops-tools

observability-aiops

loki_tail_errors

Read-only

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.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
hoursNo
limitNo
targetNo
selectorYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.7.0

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already establish readOnlyHint=true, so safety is covered. The description goes further by disclosing runtime behavior the annotations cannot: hours are capped at a max lookback, limit is clamped to a max line limit, and a truncated envelope signals a partial result that should be re-run with a higher limit. That truncation disclosure is the kind of operational context agents need.

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?

Front-loaded with a one-line purpose tagged [READ], then organized Args and Returns sections. Every sentence carries information; the only mild redundancy is the [READ] tag duplicating readOnlyHint.

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

Completeness4/5

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

With no output schema, the description compensates by describing the return envelope (returned/limit/truncated) and the action to take when truncated. Combined with per-parameter semantics, an agent has what it needs to call and interpret the tool, leaving only default values unstated.

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

Parameters4/5

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

Schema description coverage is 0%, so the description carries the burden and largely does: it gives selector syntax examples, and explains that hours is a lookback capped at a max, limit is clamped, and target selects a named Loki target with default fallback. All four params gain meaning, though exact defaults (hours=1, limit=100) are left to the schema.

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

Purpose4/5

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

States a specific verb and resource: an error-level read of a Loki stream, with the phrase 'error line-filter' clarifying it returns only error lines. It is distinguishable from loki_query in practice, but it never names that sibling explicitly, so the differentiation is left to inference.

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

Usage Guidelines3/5

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

The word 'canned' implies a convenience shortcut for a common case (grabbing recent error logs), which lets an agent infer when to reach for it over the generic loki_query. However, there is no explicit when-to-use statement and no exclusion or alternative named, so guidance is only implied.

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