Skip to main content
Glama

prom_active_alerts

Monitor and list currently firing Prometheus alerts to identify active infrastructure issues requiring immediate attention.

Instructions

List all currently firing Prometheus alerts

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The actual handler logic for `prom_active_alerts`, which fetches alerts from the Prometheus API and formats them into a table.
    export async function activeAlerts(): Promise<string> {
      const url = `${config.prometheusUrl}/api/v1/alerts`;
      const res = await fetch(url);
      if (!res.ok) throw new Error(`Failed to fetch alerts: ${res.status}`);
    
      const data = (await res.json()) as { data: { alerts: Array<{ state: string; labels: Record<string, string>; annotations: Record<string, string> }> } };
      const alerts = data.data?.alerts || [];
    
      const firing = alerts.filter((a: { state: string }) => a.state === "firing");
      if (firing.length === 0) return "No active alerts firing.";
    
      const headers = ["ALERT", "STATE", "SEVERITY", "SUMMARY"];
      const rows = firing.map((a: { labels: Record<string, string>; annotations: Record<string, string>; state: string }) => [
        a.labels.alertname || "unknown",
        a.state,
        a.labels.severity || "N/A",
        (a.annotations?.summary || a.annotations?.description || "").substring(0, 60),
      ]);
    
      return `Active alerts (${firing.length} firing):\n\n${formatTable(headers, rows)}`;
    }
  • Registration of the `prom_active_alerts` tool in the Prometheus tools list.
      name: "prom_active_alerts",
      description: "List all currently firing Prometheus alerts",
      inputSchema: { type: "object" as const, properties: {} },
    },
  • Routing logic inside `handlePrometheusTool` that dispatches the `prom_active_alerts` tool call to the `activeAlerts` function.
    case "prom_active_alerts": return activeAlerts();
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. While 'List' implies a read-only operation, it doesn't specify whether this tool requires authentication, has rate limits, returns real-time data, or includes metadata like alert durations. For a monitoring tool with zero annotation coverage, this is a significant gap.

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?

The description is a single, efficient sentence that front-loads the core functionality ('List all currently firing Prometheus alerts'). There is no wasted verbiage or redundant information, making it highly concise and well-structured.

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

Completeness3/5

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

Given the tool's simplicity (0 parameters, no output schema), the description is minimally adequate. However, it lacks context about the return format (e.g., JSON structure, alert fields) and behavioral traits like error handling or dependencies. Without annotations or output schema, the description should ideally provide more operational context for a monitoring tool.

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?

The tool has 0 parameters with 100% schema description coverage, so no parameter documentation is needed. The description doesn't add parameter details, which is appropriate. A baseline of 4 is applied since no parameters exist, and the description doesn't introduce confusion about inputs.

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 clearly states the verb ('List') and resource ('currently firing Prometheus alerts'), making the purpose specific and unambiguous. It distinguishes itself from sibling tools like prom_alert_rules (which likely lists alert rules rather than active alerts) and prom_instant_query/prom_range_query (which are for querying metrics).

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., Prometheus server availability), nor does it differentiate from similar tools like prom_alert_rules or general query tools. Usage context is implied but not explicitly stated.

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/batu-sonmez/infraclaude'

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