Skip to main content
Glama

labels

Read-onlyIdempotent

Discover which label names exist in a Loki time window when the log schema is unknown. Use them to build valid selectors for LogQL queries; only streams with data in the window contribute.

Instructions

List the label names Loki knows about in a time window.

Start here when the log schema is unknown: labels gives the names (app, namespace, level), then label_values gives the values for one of them, and together they let you write a valid selector for query_range. Only labels present on streams that received data inside the window are returned, so widening start/end surfaces more.

Returns the raw Loki JSON response: {"status","data":["label","names"]}. Read-only: it never writes to or mutates Loki.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
endNoEnd of the time range, RFC3339 or Unix nanoseconds. Defaults to now.
startNoStart of the time range, RFC3339 (2026-03-25T10:00:00Z) or Unix nanoseconds. Defaults to 6 hours ago.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.0.3
    • changedInput schema / properties / end / description
      Previous value: -"End of time range (RFC3339 or Unix nanoseconds). Defaults to now"New value: +"End of the time range, RFC3339 or Unix nanoseconds. Defaults to now."
    • changedInput schema / properties / start / description
      Previous value: -"Start of time range (RFC3339 or Unix nanoseconds). Defaults to 6 hours ago"New value: +"Start of the time range, RFC3339 (2026-03-25T10:00:00Z) or Unix nanoseconds. Defaults to 6 hours ago."
  2. First observedv0.1.0

TDQS

A4.9/5.0
Behavior5/5

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

Annotations already declare readOnlyHint=true and idempotentHint=true. The description reinforces with 'Read-only: it never writes to or mutates Loki' and adds the raw return format ('{"status","data":["label","names"]}') plus the behavior about only labels present on streams with data in the window. This goes beyond the annotations.

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-load the purpose, then explain the workflow and return format. Every sentence earns its place, with no redundancy or 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?

For a simple read-only list tool with two optional parameters and no output schema, the description fully explains purpose, usage context, return format, and operational behavior. Nothing an agent needs to call it correctly is missing.

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 coverage is 100% (start and end documented with types, defaults, and format). The description adds the insight that widening start/end surfaces more labels, which is extra semantic value beyond the schema, but the core semantics are already covered.

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 clearly states the verb 'List' the resource 'label names' within 'Loki' and a time window. It differentiates itself from siblings by explicitly contrasting with label_values and query_range, and positioning itself as the starting point for schema discovery.

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 directs the agent: 'Start here when the log schema is unknown' and describes the sequence labels → label_values → query_range. It also gives a practical tip about widening start/end to surface more labels, making the intended use unambiguous.

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

Deploy Server

Other Tools