Skip to main content
Glama
igorolv

loki-mcp-server

discoverLogs

discoverLogs
Read-onlyIdempotent

List Loki label names and values before writing LogQL. Use a stream selector to inspect label sets, then confirm log lines with counts or queries.

Instructions

Discover labels before writing LogQL. Without label or match, list label names; label="app" lists its values. match="{app=\"api\"}" lists complete stream label sets; add label="namespace" to list namespace values among those sets. Use a narrow match and time window, then countLogs or queryLogs to check log lines.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
endNoWindow end, default now. Use the end in a queryLogs footer to read older lines.
labelNoOptional label name, e.g. "app": list its values
matchNoOptional LogQL stream selector, e.g. {app="api"}; no line filters
startNoWindow start, default now-1h. Examples: now-15m, now-2d, 2026-09-13T10:00:00+03:00.
connectionYesConnection name from listConnections

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.7/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, destructiveHint=false and openWorldHint, so the safety profile is covered. The description adds genuinely useful behavior beyond that: output depends on inputs (no args = label names, label only = its values, match = full stream label sets), which is not derivable from annotations alone.

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 dense sentences, each carrying distinct information: purpose, the three input-dependent behaviors, and the recommended workflow. The purpose is front-loaded and there is no filler.

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?

There is no output schema, and the description compensates by describing the three possible return shapes based on inputs, plus time-window guidance. For a 5-parameter read-only discovery tool, an agent has everything needed to call it and interpret the result.

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 100%, so the baseline is 3. The description goes further by explaining the combined semantics of label and match (e.g. 'add label="namespace" to list namespace values among those sets') and the window-scoping intent, which the parameter descriptions only partially convey.

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 ('Discover labels') and immediately scopes it to the LogQL workflow, which clearly separates it from countLogs and queryLogs. An agent can tell this is a metadata/label exploration tool rather than a log-reading tool without opening any 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?

Explicitly says to run this 'before writing LogQL', recommends a narrow match and time window, and routes the agent onward ('then countLogs or queryLogs to check log lines'). It names the sibling tools and the condition for using each, leaving nothing to inference.

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