Skip to content

MCP: allow filtering get_active_alerts by cluster #4287

@ebarron

Description

@ebarron

Summary

Add an optional cluster parameter to the get_active_alerts MCP tool so users can list firing alerts for a specific cluster (or set of clusters), instead of always returning every alert in the TSDB.

Background

get_active_alerts calls Prometheus's /api/v1/alerts endpoint directly and returns the full list with no filter parameter. In multi-cluster Harvest deployments this is often too noisy — operators usually want "what's firing in prod-east-1?" not "what's firing across all 30 clusters?".

Proposed enhancement

Add an optional argument:

  • cluster — exact cluster name, or
  • cluster_match — regex pattern matched against the cluster label of each alert.

After fetching alerts from /api/v1/alerts, filter the returned list (and the severity counts) so only alerts whose labels.cluster matches the requested cluster(s) are included. When omitted, behavior is unchanged.

Use cases

  • "Any active alerts in prod-east-1?"
  • Drilling down from infrastructure_health to per-cluster alert details.
  • Per-datacenter chatbot/ops conversations.

Notes

Filed as part of a NAbox chatbot integration review. The other harvest-mcp query tools allow cluster scoping via PromQL label matchers; get_active_alerts and infrastructure_health are the two "what's wrong?" tools that currently can't be narrowed to a cluster. (Companion issue: #4286.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions