Audits a Loki label strategy and optionally diagnoses query performance. Returns per-label verdicts, missing base labels, normalisation issues, and a recommended set. Pass datasourceUid for live cardinality or labels for static scoring; both may be combined.
AI agents call analyze_loki_labels to retrieve information from Mcp Grafana Npx without modifying anything — typically the context-gathering step in research, monitoring, and reporting workflows, before the agent takes action elsewhere.
| Parameter | Type | Required | Description |
|---|---|---|---|
labels | array | — | Caller-supplied labels (static mode). |
selector | string | — | Optional LogQL selector for stats / perf diagnosis. |
maxLabels | integer | — | |
endRfc3339 | string | — | |
perfMetrics | object | — | Runtime metrics; presence triggers perf diagnosis. |
startRfc3339 | string | — | |
datasourceUid | string | — | Datasource UID (live mode). |
expectedBaseLabels | array | — |
Parameters from the server's own tool schema.
This tool performs analysis and auditing of Loki labels and query performance. It retrieves and evaluates information but does not create, modify, delete, or execute arbitrary operations. The tool's purpose is informational: providing verdicts, diagnoses, and recommendations.
From the tool's definition The tool 'analyze_loki_labels' audits and diagnoses without modifying data. It 'returns per-label verdicts, missing base labels, normalisation issues, and a recommended set' and accepts 'datasourceUid for live cardinality or labels for static scoring' —…
Risk signalsHigh parameter count (22 properties)
Attacks that exploit this kind of access
Audits a Loki label strategy and optionally diagnoses query performance. Returns per-label verdicts, missing base labels, normalisation issues, and a recommended set. Pass datasourceUid for live cardinality or labels for static scoring; both may be combined. It is categorised as a Read tool in the Mcp Grafana Npx MCP Server, which means it retrieves data without modifying state.
analyze_loki_labels accepts 8 parameters: labels, selector, maxLabels, endRfc3339, perfMetrics, startRfc3339, datasourceUid, expectedBaseLabels. The full parameter table on this page comes from the server's own tool schema.
Register the Mcp Grafana Npx MCP server in PolicyLayer and add a rule for analyze_loki_labels: allow, deny, rate-limit, or require approval. Point your MCP client at the PolicyLayer proxy URL and the rule is enforced on every call, before it reaches Mcp Grafana Npx. Nothing to install.
analyze_loki_labels is a Read tool with low risk. Read-only tools are generally safe to allow by default.
Yes. Add a rate_limit block to the analyze_loki_labels rule in your PolicyLayer policy. For example, setting max: 10 and window: 60 limits the tool to 10 calls per minute. Rate limits are tracked per agent session and reset automatically.
Set action: deny in the PolicyLayer policy for analyze_loki_labels. The AI agent will receive a policy violation error and cannot call the tool. You can also include a reason field to explain why the tool is blocked.
analyze_loki_labels is provided by the Mcp Grafana Npx MCP server (mcp-grafana-npx). PolicyLayer sits as a proxy in front of this server to enforce policies before tool calls reach the server.
Every MCP server has a record like this.
Type a name, get the same breakdown: verified identity, auth posture, risk grade, capabilities, recommended policy.
Teams ship this data inside their own products. See what a licence covers →