Repository navigation
feat(alerts): MCP tools for alert silences - #2291
Merged
Merged
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_silenceandend_alert_silenceregistered with typed input errors- Default silence list shares one limit window between active and scheduled silences
get_incident_timelinenames the silence that held a page back, with its reason
Still open from earlier reviews
- 🔵 Note · F5 · Fixed settled-hold wording in
silenceLinehas no test ·apps/ai/src/mcp/tools/get-incident-timeline.ts:62 - 🔵 Note · F6 ·
silenceReasonsruns one Postgres query per distinct silence id ·apps/ai/src/mcp/tools/get-incident-timeline.ts:35 - 🔵 Note · F7 ·
ALERT_SILENCE_STATUSESre-spells the domain'sAlertSilenceStatusliteral ·apps/ai/src/mcp/lib/alert-silences.ts:15
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:
listfilters$.orgIdandfindRowfilters orgId and id (AlertSilencesService.ts:121,178) - The 30-day cap in
create_alert_silenceis checked before any date maths and matchesMAX_ALERT_SILENCE_DURATION_MS - The
secondSharearithmetic never returns more thanlimitrows; 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.
Loading