Skip to content

feat(alerts): MCP tools for alert silences - #2291

Merged
Makisuo merged 35 commits into
mainfrom
feat/alert-silences-mcp
Nov 6, 2026
Merged

Makisuo merged 35 commits into
mainfrom
feat/alert-silences-mcp

fix(mcp): page one silence status with an offset, cap silence duratio…

7695cf4
Select commit
Loading
Failed to load commit list.
Maple Review Bot / Maple / review succeeded Nov 6, 2026 in 1m 49s

Confidence 9/10 · No issues found

🟢 Confidence 9/10 · safe to merge. Scoping, validation and the new list window check out at this head; only the earlier info-level notes (untested settled-hold wording, per-id silence lookups, re-spelled status literal) remain open.
3 notes · tests partial −1 · risk medium · 4/4 new units observable

Adds three MCP tools for alert silences and a silence line on the incident timeline; tenant scoping, duration caps and the default list's active/scheduled window hold. It does not touch the McpQueryError stack in registry.ts, and three earlier info notes remain open.

  • list_alert_silences, create_alert_silence and end_alert_silence registered with typed input errors
  • Default silence list shares one limit window between active and scheduled silences
  • get_incident_timeline names the silence that held a page back, with its reason

Still open from earlier reviews

Production impact

Open errors in the changed files (2)
Issue Service Occurrences File
@maple/mcp/errors/McpQueryError (4 issues) maple-chat 30 apps/ai/src/mcp/tools/registry.ts
@maple/mcp/errors/McpQueryError (6 issues) maple-ai 18 apps/ai/src/mcp/tools/registry.ts

After this merges, Maple checks whether they stop.

Telemetry this change adds and removes (5)
  • ➕ span name McpTool.createAlertSilence · apps/ai/src/mcp/tools/create-alert-silence.ts:47
  • ➕ span name McpTool.endAlertSilence · apps/ai/src/mcp/tools/end-alert-silence.ts:22
  • ➕ span name McpTool.getIncidentTimeline.silenceReasons · apps/ai/src/mcp/tools/get-incident-timeline.ts:29
  • ➕ span name McpTool.listAlertSilences · apps/ai/src/mcp/tools/list-alert-silences.ts:31
  • ➕ attribute maple.ai.silence_status · apps/ai/src/mcp/tools/list-alert-silences.ts:59
What was checked
  • Silence reads stay org-scoped: list filters $.orgId and findRow filters orgId and id (AlertSilencesService.ts:121,178)
  • The 30-day cap in create_alert_silence is checked before any date maths and matches MAX_ALERT_SILENCE_DURATION_MS
  • The secondShare arithmetic never returns more than limit rows; walked limit 1, 2, 50 and 200 with full and partial pages
Observability coverage: 4 of 4 changes observable
Change Kind Observable Evidence
list_alert_silences MCP tool inbound entrypoint yes Effect.fn("McpTool.listAlertSilences") plus annotateCurrentSpan status/rowCount (list-alert-silences.ts:31,57)
create_alert_silence MCP tool inbound entrypoint yes Effect.fn("McpTool.createAlertSilence") span; service annotates maple.alert_silence.id
end_alert_silence MCP tool inbound entrypoint yes Effect.fn("McpTool.endAlertSilence") span
silence reason lookup on the incident timeline outbound database read yes runs inside the McpTool.getIncidentTimeline span, one Effect.fn child per id, failures logWarning with silenceId

7695cf4 · Reply "won't fix" to dismiss a finding, or mention @maple-review-bot to ask about one.