Skip to main content
Glama
mshegolev

mshegolev/prometheus-mcp

prometheus_list_targets

Read-onlyIdempotent

List scrape targets with health status, last scrape duration, and errors. Grouped by job and health to quickly identify down targets and investigate failures.

Instructions

List Prometheus scrape targets, summarised by job and health.

Wraps GET /api/v1/targets. Returns scrape targets with job name, instance address, health status (up / down / unknown), last scrape duration in milliseconds, and any last error. Also returns a summary grouped by job and health state.

Examples: - Use when: "Which targets are currently down?" → filter targets where health='down' and check last_error. - Use when: "How many instances of the 'node-exporter' job are up?" → check job_summary for the 'node-exporter' entry. - Use when: Investigating a scrape failure — list targets for the affected job to see which instances have errors. - Don't use when: You want metric values from a target (call prometheus_query with label matchers instead). - Don't use when: You want alert status (call prometheus_list_alerts instead).

Returns: dict with state_filter / total_count / up_count / down_count / unknown_count / job_summary (per-job health counts) / targets (list with job, instance, health, last_scrape_duration_ms, last_error, labels).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
stateNoFilter targets by state: 'active' (default, scrape targets Prometheus is scraping), 'dropped' (targets that were dropped by relabelling), or 'any' (all targets regardless of state).active

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
state_filterYes
total_countYes
up_countYes
down_countYes
unknown_countYes
job_summaryYes
targetsYes
Behavior5/5

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

Annotations already indicate read-only, idempotent, non-destructive. Description adds that it wraps GET /api/v1/targets, details return fields, and explains grouping by job/health. No contradictions.

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

Conciseness5/5

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

Front-loaded with purpose, then tech detail, then clear examples, then return structure. No wasted sentences; each sentence adds value.

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

Completeness5/5

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

Given the simple tool (1 param, full schema, output described), the description covers all essential aspects: purpose, usage, return format, and exclusions.

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 covers the single parameter fully (100% coverage). Description doesn't add new semantics but includes examples that use the state filter. Adequate, no degradation.

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?

States clearly: 'List Prometheus scrape targets, summarised by job and health.' Distinguishes from siblings by explicitly naming alternatives (prometheus_list_alerts, prometheus_query).

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?

Provides specific examples of when to use (checking down targets, job summary, scrape failure) and explicit 'Don't use when' with alternative tool names.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mshegolev/prometheus-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server