Skip to main content
Glama
snickery

loki-tail-mcp

by snickery

loki_query_range

Run LogQL range queries to retrieve logs or metrics from Loki over a specified time period, outputting compact timestamped results.

Instructions

Run a LogQL range query against Loki.

query: LogQL expression, e.g. {container="nginx"} |= "ERROR" or a metric query like rate({container="traefik"}[5m]). start: Duration back from now (15m, 2h, 3d), RFC3339 timestamp, or ns-since-epoch. Default 1h. end: Same format as start. Default now. limit: Max log lines to return (clamped to server max, default 100). direction: backward (newest first) or forward. Default backward.

Returns compact timestamp [labels] message lines, newest first. For metric queries returns {labels} ts:val ts:val ... per series.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
endNonow
limitNo
queryYes
startNo1h
directionNobackward

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

With no annotations provided, the description carries the full burden. It discloses defaults for start/end/direction, limit clamping, and the return format for both log and metric queries. It doesn't mention auth or rate limits, but these are not critical for a query tool's behavior.

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, with each parameter on its own line and a separate return format explanation. It is concise yet complete, with no redundant or filler content.

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?

The tool has 5 parameters and no annotations, but the description covers all parameters, defaults, output formats, and provides query examples. It is complete enough for an agent to select and invoke the tool correctly without further clarification.

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%, so the description fully compensates by explaining each parameter: query syntax, start/end formats (duration, RFC3339, ns epoch), limit handling, and direction semantics with defaults. This adds substantial meaning beyond the bare 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 states 'Run a LogQL range query against Loki' with concrete examples, clearly distinguishing this range query tool from the instant query sibling. The verb and resource are specific and unambiguous.

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 gives clear context for when to use this tool (querying over a time range) and explains behaviors like defaults and return formats. It doesn't explicitly name alternatives or exclusions, but the range query nature and parameter details imply appropriate usage versus instant queries or tailing.

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/snickery/loki-tail-mcp'

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