Grafana: List Labels
grafana_list_labelsList label names or values for Prometheus and Loki datasources, filtered by selector and time range, to discover what series or streams to query.
Instructions
Discover what to query, for a Prometheus or Loki datasource: with no label, the label names in use; with label, the values it takes (label=name lists Prometheus metric names). Restrict with selector to the series or streams that matter, e.g. the pods of one namespace. Looks at the last hour unless start is given — the datasource default is its whole retention, which returns everything that ever existed.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "grafana_list_labels"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| end | No | Window end: now, now-1h, -30m, now/d or now-1d/d (rounded in UTC: a start to the start of the day, an end to its end), an RFC3339 timestamp (2026-01-31T12:00:00Z) or unix seconds/ms. Defaults to now. | |
| label | No | A label name, e.g. "namespace", or "__name__" for Prometheus metric names. Omit to list label names. | |
| limit | No | Maximum values (1-10000). Defaults to 500. | |
| start | No | Window start: now, now-1h, -30m, now/d or now-1d/d (rounded in UTC: a start to the start of the day, an end to its end), an RFC3339 timestamp (2026-01-31T12:00:00Z) or unix seconds/ms. Defaults to now-1h. | |
| search | No | Case-insensitive substring to filter by, e.g. `nginx`. | |
| selector | No | A series or stream selector to restrict to, e.g. `{namespace="monitoring"}` or, for Prometheus, a metric name like `kube_pod_info`. A selector only, no functions. | |
| datasource | No | Datasource uid or name, e.g. "prometheus" or "Loki". Defaults to the default datasource. grafana_list_datasources lists them. |