Skip to main content
Glama
sandraschi

Observability MCP Server

query_loki_logs

Query Loki logs with LogQL syntax and advanced filtering to correlate logs, metrics, and traces across services.

Instructions

Query logs from Loki with advanced filtering and analysis.

This tool provides powerful log querying capabilities using Loki's LogQL syntax, enabling correlation between logs, metrics, and traces.

Input Schema

NameRequiredDescriptionDefault
limitNoMaximum number of log entries to return (1-1000)
queryYesLogQL query string (e.g., '{job="my-service"} |= "ERROR"')
end_timeNoEnd time for query (ISO format or relative)
start_timeNoStart time for query (ISO format or relative like "1h", "24h")

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

C2.9/5.0
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It is silent on whether the call is read-only, what the default time window is when start_time/end_time are null, whether results are truncated at the limit, and whether there are rate or timeout constraints — all critical for a log query tool.

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

Conciseness3/5

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

It is short and front-loaded with the core verb, but the second sentence is largely promotional ("powerful log querying capabilities") and its correlational framing earns little. Roughly half the text is filler that could be spent on behavior.

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

Completeness3/5

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

An output schema exists and parameter docs are complete, so return-value explanation is rightly omitted. However, for a LogQL query tool the description leaves undefined the default time range, result-limit behavior, and read-only nature — gaps the agent must guess at when invoking.

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

Parameters3/5

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

Schema description coverage is 100%, so the parameter baseline is 3. The description adds the term LogQL and implies filter construction, but supplies no extra meaning about limit truncation, relative time syntax, or default range beyond what the schema already documents.

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?

The first sentence gives a specific verb and resource ("Query logs from Loki") and the schema confirms the dialect is LogQL. It does not differentiate this tool from adjacent siblings such as analyze_log_patterns, correlate_logs_and_metrics, or send_logs_to_loki, so an agent has to infer the boundary rather than read it.

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

Usage Guidelines2/5

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

There is no statement of when to use this tool versus the pattern-analysis or correlation siblings, nor any prerequisites (datasource selection, tenant, permissions). The closing phrase about "correlation between logs, metrics, and traces" gestures at a use case but never names an alternative or an exclusion.

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