Skip to main content
Glama
mshegolev

mshegolev/prometheus-mcp

prometheus_list_targets

Read-onlyIdempotent

Retrieve Prometheus scrape targets with health status, job summary, and error details. Identify down instances and investigate scrape 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
instanceNoTarget instance name (omit for default instance)

Output Schema

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

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

Annotations already declare readOnlyHint, idempotentHint, destructiveHint. Beyond that, description adds that it wraps a specific API endpoint, returns a summary grouped by job and health, and lists fields of the return dictionary. This provides useful behavioral context.

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 description is well-structured with clear sections (purpose, API reference, examples, returns). It is slightly lengthy but each sentence provides value, and the examples are particularly helpful.

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 tool's complexity (wrapping an API, returning both a list and summary), the description covers purpose, usage, return format, and examples. An output schema exists, so the description need not fully document return values, yet it still provides an overview.

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 description coverage is 100%, so baseline is 3. Description does not add significant meaning beyond what the schema already provides for the parameters, focusing instead on usage examples and return values.

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?

The description states 'List Prometheus scrape targets, summarised by job and health.' It is a specific verb+resource and distinguishes from siblings like prometheus_list_alerts and prometheus_query through 'Don't use when' guidance.

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 explicit when-to-use examples (e.g., 'Which targets are currently down?') and when-not-to-use with alternative tool names (e.g., call prometheus_query instead). This clearly guides appropriate usage.

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