analyze_loki_labels

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.

Server Mcp Grafana Npx mcp-grafana-npx
Category Read
Risk class Low
Parameters 80 required

What analyze_loki_labels does on Mcp Grafana Npx

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.

ParameterTypeRequiredDescription
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.

Why analyze_loki_labels needs a policy

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)

Questions about analyze_loki_labels

What does the analyze_loki_labels tool do? +

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.

What parameters does analyze_loki_labels accept? +

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.

How do I enforce a policy on analyze_loki_labels? +

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.

What risk level is analyze_loki_labels? +

analyze_loki_labels is a Read tool with low risk. Read-only tools are generally safe to allow by default.

Can I rate-limit analyze_loki_labels? +

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.

How do I block analyze_loki_labels completely? +

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.

What MCP server provides analyze_loki_labels? +

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.

// LOOK UP ANOTHER 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 →

// GET IN TOUCH

Have a question or want to learn more? Send us a message.

Message sent.

We'll get back to you soon.