Skip to main content
Glama
AIops-tools

observability-aiops

alert_log_context

Pulls the Loki log streams that match a firing Prometheus alert, using shared labels to surface correlated error logs for faster root-cause analysis.

Instructions

[READ][cross-signal] Correlate a firing Prometheus alert to its Loki log streams.

Reads the firing alert's labels from the Prometheus target, maps the Loki-friendly ones (namespace, job, service, app, container, pod, instance, component — first four, in that priority order) into a LogQL stream selector, and pulls the correlated error streams from the Loki target. Best-effort: label values are escaped into the selector and only labels the alert and Loki actually share will match.

Args: alertname: The firing alert's name (from firing_alerts / firing_alert_rca). hours: Lookback window in hours (capped at the tool's max lookback). target: Prometheus target name from config; omit for the default. loki_target: Loki target name from config; omit for the default.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
hoursNo
targetNo
alertnameYes
loki_targetNo
Behavior5/5

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

With no annotations, the description fully discloses behavioral traits: it is a read operation, maps labels in priority order, escapes values, only matches shared labels, and caps the lookback window. This goes well beyond minimal disclosure and prevents misuse.

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

Conciseness5/5

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

The description is well-structured: a one-line summary, a behavioral explanation, and an Args list. Every sentence adds value, and the length is justified by the need to explain parameter semantics and cross-signal mapping without schema descriptions.

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 tool's cross-signal complexity, four parameters, no output schema, and no annotations, the description covers purpose, usage, parameter semantics, and behavioral caveats. It is sufficiently complete for an agent to invoke the tool correctly and interpret the intention.

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?

Schema description coverage is 0%, but the Args section adds detailed meaning to every parameter: alertname is tied to firing_alerts/firing_alert_rca, hours is a capped lookback, and target/loki_target indicate config defaults. This fully compensates for the absence of schema descriptions.

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 opens with '[READ][cross-signal] Correlate a firing Prometheus alert to its Loki log streams,' which uses a specific verb and resource and clearly distinguishes it from sibling tools like loki_query or firing_alert_rca. It states exactly what the tool does and the cross-signal nature.

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

Usage Guidelines4/5

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

The description provides clear context on when to use the tool (for correlating alerts to logs) and explains its Best-effort behavior and label-matching constraints. It does not explicitly name alternative tools or state when not to use it, but the context is strong enough for an agent to determine applicability.

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/AIops-tools/Observability-AIops'

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