Skip to main content
Glama
mgcrea

mcp-prometheus

by mgcrea

Prometheus: List Targets

prometheus_list_targets
Read-only

Lists Prometheus scrape targets, defaulting to unhealthy ones with their last errors, so you can identify which metrics collection is failing and why.

Instructions

Scrape health: what Prometheus is failing to collect, and why. Always returns totals and every scrape pool with an unhealthy target; then lists targets, by default only the unhealthy ones with their lastError (a 404 is usually a wrong metrics path or port, a timeout a slow exporter, connection refused a pod not listening). A target that is down means its metrics stop — queries over it go quiet rather than erroring. Only active targets: the dropped ones (filtered out by relabeling) run to megabytes and are never fetched.

Input Schema

NameRequiredDescriptionDefault
limitNoMaximum targets to list (1-1000). Defaults to 50.
healthNoWhich targets to list. unhealthy (the default) = down or unknown; the totals always count all of them.unhealthy
searchNoCase-insensitive substring matched against pool, instance, job and label values, e.g. a namespace.
scrape_poolNoOnly this scrape pool, by exact name, e.g. `serviceMonitor/monitoring/node-exporter/0`. Filtered by Prometheus, so it is also the cheap way to inspect one big pool.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.1/5.0
Behavior4/5

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

Annotations only declare readOnlyHint, so the description carries most of the burden and does well: it states the return shape is always totals plus every pool with an unhealthy target, that the default filter lists only unhealthy targets, how to interpret lastError strings, and that dropped targets are excluded due to size. It stops short of describing pagination/truncation behavior around the limit or any auth prerequisites.

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?

The core purpose (scrape health) is front-loaded, and the following sentences are dense with operational detail rather than filler. The lastError parenthetical is long but earns its place by teaching error interpretation.

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?

With no output schema and only a readOnlyHint annotation, the description adequately covers return structure at a high level (totals, pools, targets with lastError), the default filtering behavior, and the exclusion of dropped targets. Fine for an agent to call it correctly, though the exact fields of each target entry are not enumerated.

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

Parameters3/5

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

Schema coverage is 100%, so every parameter is already documented in the schema, making 3 the baseline. The description reinforces the health default and the scrape_pool shortcut but adds little syntax or interpretive detail beyond what the schema already states.

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?

Opens with a specific framing — 'Scrape health: what Prometheus is failing to collect, and why' — and names the concrete resource (scrape targets/pools). It is clearly distinct from siblings like prometheus_query, prometheus_list_metrics, and prometheus_get_tsdb_status, which cover querying, metric discovery, and storage rather than scrape health.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It explains when this tool matters — 'A target that is down means its metrics stop — queries over it go quiet rather than erroring' — implicitly telling the agent to reach for it when metrics are missing rather than querying. It also notes the scrape_pool filter as 'the cheap way to inspect one big pool' and that dropped targets are never fetched. No explicit 'use X instead' routing to a sibling, which keeps it below 5.

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