Skip to main content
Glama

label_values

Read-onlyIdempotent

List distinct values for a label in Loki over a specified time window, helping you build exact selectors for log queries. Returns raw JSON and is read-only.

Instructions

List the values a single label takes in Loki over a time window.

Use it after labels to fill in a selector: labels says "app" exists, label_values with label="app" says which apps are actually logging, and one of those goes into {app="..."} for query_range. Only values seen inside the window are returned, so widening start/end surfaces more.

Returns the raw Loki JSON response: {"status","data":["value","list"]}. An unknown label name is not an error; it comes back as an empty list. 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.
labelYesLabel name to look up, as returned by the labels tool (e.g. app, namespace, level). Must match ^[a-zA-Z_][a-zA-Z0-9_]*$.
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. Changed4 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 / label / description
      Previous value: -"Label name to retrieve values for"New value: +"Label name to look up, as returned by the labels tool (e.g. app, namespace, level). Must match ^[a-zA-Z_][a-zA-Z0-9_]*$."
    • addedInput schema / properties / label / pattern
      Added value: +"^[a-zA-Z_][a-zA-Z0-9_]*$"
    • 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

A5/5.0
Behavior5/5

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

The description discloses the raw JSON response format, the empty-list behavior for unknown labels, and explicitly states 'Read-only: it never writes to or mutates Loki.' This adds behavioral context beyond the annotations (readOnlyHint, destructiveHint, idempotentHint) by clarifying exact response shape and error 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 about 70 words, front-loaded with the core action, then logically flows into usage, behavior, and return format. Every sentence carries useful information, with no filler or redundancy.

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?

It covers purpose, usage pattern, response format, edge cases (unknown label), read-only guarantee, and parameter interpretation. The presence of annotations and sibling context fills remaining gaps, making this fully self-sufficient for an agent.

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?

Although the schema covers 100% of parameters, the description adds significant meaning: it ties start/end to the time-window semantics, gives an example ('app') for the label pattern, and explains the default values. This elevates the parameters from syntax to usage.

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 starts with a clear, specific verb and resource ('List the values a single label takes in Loki over a time window') and immediately distinguishes it from siblings by explaining when to use it (after labels, before query_range). It names the exact context and how it fits the workflow.

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?

It explicitly states when to use this tool: 'Use it after labels to fill in a selector' and walks through a concrete example (labels says 'app' exists, label_values gives actual values, one goes into query_range). It also notes the effect of widening start/end, giving clear guidance on parameter usage.

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