---
id: w3/m8/t004
title: MCP list_log_label_values + REST/GraphQL filter-suggestion reads
worker: worker3
status: todo
estimate: 30m
depends_on: [w3/m8/t003]
---

## Objective

Label discovery so clients stop guessing: MCP `list_log_label_values` under the official server's exact name/args/shape (agents ask "what levels/statuses exist for this service?"), plus REST/GraphQL filter-suggestion reads mirroring the shipped `metricsFilters` pattern — one service method, three thin adapters, backed by Loki's label-values API scoped to the caller's service selector (no cross-tenant label leakage).

## Context

- Official tool contract: `render-oss/render-mcp-server` — mirror precisely; drift is a finding.
- Pattern precedent: the metrics feature's filter-suggestion reads (`lego/backend/internal/metrics/`).
- Tenancy: scope every label query by the service's stream selector — a bare label-values call over the whole store would leak other tenants' pod/app names.

## Files

- `lego/backend/internal/logs/{service,rest,graphql,mcp}.go`
- `docs/ADR006-bex-api.md` (MCP table + REST/GraphQL rows)

## Acceptance criteria

- [ ] Tool name/args match the official server; values returned are scoped to the requested service only; three surfaces agree.

## Out of scope

- Dashboard filter dropdowns consuming this (t006 files UI drift as a w5 note).
