Skip to main content
Glama
mcp-prometheus

mcp-prometheus

by mgcrea

Prometheus: List Metrics

prometheus_list_metrics
Read-only

Find Prometheus metric names by substring across names and help text, returning type and help. Use it to discover metrics before writing a PromQL query.

Instructions

Find metric names, with their type (counter, gauge, histogram, summary) and help text. search matches the name or the help text, so disk finds node_filesystem_avail_bytes by its description. Use this before writing a query against a metric you have not seen, then prometheus_describe_metric for its labels. Counters need rate() or increase(); summing a raw counter is the most common PromQL mistake.

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": "prometheus_list_metrics"
  }
}

Input Schema

NameRequiredDescriptionDefault
endNoOnly consider series with samples before this: now, now-1h, -30m, an RFC3339 timestamp (2026-01-31T12:00:00Z) or unix seconds. Defaults to now.
limitNoMaximum metrics to return (1-1000). Defaults to 100.
matchNoA series selector to restrict to, e.g. `{namespace="monitoring"}` or `up{job=~"kube.*"}`. A selector only — no functions or operators. An empty matcher set `{}` is rejected by Prometheus; use at least one non-empty matcher such as `{job=~".+"}`.
startNoOnly consider series with samples after this: now, now-1h, -30m, an RFC3339 timestamp (2026-01-31T12:00:00Z) or unix seconds. Defaults to an hour before end (now-1h when end is not given), i.e. series that exist now. Pass now-30d to include ones that have since gone away.
searchNoCase-insensitive substring to filter by, e.g. `http`.
metadataNoInclude type and help per metric. false returns bare names, about a fifth the size.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.2.0
    • changedInput schema / properties / start / description
      Previous value: -"Only consider series with samples after this: now, now-1h, -30m, an RFC3339 timestamp (2026-01-31T12:00:00Z) or unix seconds. Defaults to now-1h, i.e. series that exist now. Pass now-30d to include ones that have since gone away."New value: +"Only consider series with samples after this: now, now-1h, -30m, an RFC3339 timestamp (2026-01-31T12:00:00Z) or unix seconds. Defaults to an hour before end (now-1h when end is not given), i.e. series that exist now. Pass now-30d to include ones that have since gone away."
  2. First observedv0.1.0

TDQS

A4.5/5.0
Behavior4/5

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

readOnlyHint=true already tells the agent this is a safe read; the description still adds real behavior, namely that `search` matches help text as well as names (so `disk` hits node_filesystem_avail_bytes), which an agent could not infer from the schema. What is missing is any statement about the limit/truncation behavior when results exceed `limit`, so it stops short of full disclosure.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the resource and return shape, then usage, then the sibling hand-off, then the PromQL pitfall — a sensible ordering with no filler. The final sentence about rate()/increase() is slightly tangential to a listing tool, but it earns its place as a first-use guardrail.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a read-only, annotation-covered listing tool with no output schema, the description does what matters: it names the returned fields (name, type, help text) and routes to the label tool. Only the result-size/pagination story is unaddressed in prose, and the `limit` parameter's schema partially covers that.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3, but the description genuinely adds meaning beyond it: the `search` parameter's schema only says "case-insensitive substring", while the description reveals it spans name and help text and gives a worked example. The remaining parameters (start/end/match/metadata) are left entirely to the schema, which documents them well.

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?

"Find metric names, with their type (counter, gauge, histogram, summary) and help text" states a specific verb plus resource and what the result carries. It is clearly distinguished from prometheus_describe_metric (labels) and from the query tools by naming the sibling outright.

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?

"Use this before writing a query against a metric you have not seen, then prometheus_describe_metric for its labels" gives an explicit workflow position and the adjacent alternative with the condition that selects it. The closing PromQL warning adds a when-not idiom (do not sum raw counters).

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.