Skip to main content
Glama

prometheus_list_targets

Retrieve and display all active Prometheus targets for monitoring and analysis, enabling efficient oversight of your infrastructure metrics.

Instructions

List all Prometheus targets

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Core handler implementation that performs an HTTP GET request to the Prometheus /api/v1/targets endpoint to list all targets, optionally filtered by scrape pool.
    async listTargets(scrapePool?: string): Promise<TargetsResult> { const endpoint = "/api/v1/targets"; const params: Record<string, string> = {}; if (scrapePool) { params.scrapePool = scrapePool; } return this.request<TargetsResult>(endpoint, params); }
  • Tool registration in the tools array, defining metadata, empty input schema, and delegating to PrometheusClient.listTargets() method.
    defineTool<typeof EmptySchema, TargetsResult>({ capability: "discovery", name: "prometheus_list_targets", title: "List Prometheus Targets", description: "List all Prometheus targets", inputSchema: EmptySchema, type: "readonly", handle: async (client: PrometheusClient) => client.listTargets(), }),
  • Zod schema for input validation; empty object schema used by prometheus_list_targets tool.
    const EmptySchema = z.object({});

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/idanfishman/prometheus-mcp'

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