Skip to main content
Glama
mcp-loki

mcp-loki

by mgcrea

Loki: List Series

loki_list_series
Read-only

List the distinct label sets (streams) matching a Loki selector and hoist shared labels into common_labels, so you can see which pods and containers a selector covers before querying.

Instructions

List the streams (distinct label sets) matching a selector, with the labels every one shares hoisted into common_labels. Use it to see what a selector actually covers — which pods, containers and stdout/stderr streams — before querying it. For how much each one logs, use loki_get_volume instead.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "selector": "<selector>"
    },
    "name": "loki_list_series"
  }
}

Input Schema

NameRequiredDescriptionDefault
endNoRange end: now, now-1h, -30m, an RFC3339 timestamp (2026-01-31T12:00:00Z, nanosecond fractions kept) or unix seconds/nanoseconds. Defaults to now.
limitNoMaximum streams to return (1-1000). Defaults to 50.
startNoRange start: now, now-1h, -30m, an RFC3339 timestamp (2026-01-31T12:00:00Z, nanosecond fractions kept) or unix seconds/nanoseconds. Defaults to 6 hours before end.
selectorYesA stream selector, e.g. `{namespace="payments", app="api"}`. Label matchers only: no line filters or parsers. At least one matcher must not match the empty string: `{app=~".+"}` works, `{app=~".*"}` and `{}` are rejected.
hide_labelsNoLabels to leave out. Defaults to ["filename"] (a /var/log/pods/... path that repeats pod and container); [] keeps everything.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and openWorldHint=true, so safety is covered; the description adds genuine value by disclosing the return shape, specifically that labels common to all streams are hoisted into `common_labels` rather than repeated per stream. It does not discuss truncation behavior when `limit` is hit or ordering of results, which keeps it short of a 5.

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?

Three sentences, front-loaded with the operation and its output, then usage, then the alternative. No restatement of the name or title and no filler.

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?

There is no output schema, so the description's explanation of `common_labels` is doing necessary work, and it correctly defers volume/magnitude questions to a sibling. A minor gap: it does not say what each returned stream entry looks like beyond the hoisted labels, nor whether results are truncated.

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%, including selector syntax rules, time formats, limit bounds and hide_labels defaults, so the schema carries the parameter burden. The description adds no parameter-level detail beyond the schema — it only alludes to 'a selector' in prose. Baseline 3 is correct here.

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?

States a specific verb and resource — 'List the streams (distinct label sets) matching a selector' — and goes further by defining the output shape (shared labels hoisted into `common_labels`). The parenthetical gloss on 'streams' makes it distinguishable from loki_query_logs and loki_list_labels without opening a schema.

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?

Gives an explicit when-to-use: 'see what a selector actually covers — which pods, containers and stdout/stderr streams — before querying it.' It also names a concrete alternative and the condition that selects it: 'For how much each one logs, use loki_get_volume instead.' That is exactly the routing an agent needs.

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