Skip to content

homelab_alertList state filter is ignored by Alertmanager v2 #108

Closed

Description

@TMHSDigital

Summary

The state filter on homelab_alertList has no effect. Alertmanager's v2 API has no state query parameter and ignores unknown parameters, so the tool always returns every alert.

Where

  • mcp-server/src/tools/alertList.ts:13,31 (?state=${args.state}, enum active|suppressed|unprocessed)

Details

The Alertmanager v2 GET /api/v2/alerts endpoint takes the boolean params active, silenced, inhibited, and unprocessed, plus filter and receiver.

This assumes the Alertmanager v2 OpenAPI spec; I have not checked it against a live instance.

Impact

Asking for state: "active" also returns silenced and inhibited alerts, so a question like "what's firing" gets wrong answers.

Steps to reproduce

  1. Silence an alert in Alertmanager.
  2. Call homelab_alertList {state: "active"}.
  3. The silenced alert is still listed.

Suggested fix

Map each enum value to the boolean flags:

  • active: active=true&silenced=false&inhibited=false&unprocessed=false
  • suppressed: active=false&silenced=true&inhibited=true
  • unprocessed: unprocessed=true&active=false

Acceptance criteria

  • Each state returns only matching alerts
  • A mocked-SSH test asserts the generated URL

Getting started

  • Relevant files: mcp-server/src/tools/alertList.ts
  • How to run tests: cd mcp-server && npm test

Filed by repo-audit/full-audit at 9cfe5e3. Severity: medium. Effort: S. audit-key: bug|mcp-server/src/tools/alertList.ts|stateParam

Activity

  1. added
    bug
    good first issue
    severity: medium
    on Nov 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    buggood first issueseverity: medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions