Skip to content

feat(mcp): SLO tools - #2297

Merged
Makisuo merged 21 commits into
feat/slo-burn-alertsfrom
feat/slo-mcp
Nov 6, 2026
Merged

Makisuo merged 21 commits into
feat/slo-burn-alertsfrom
feat/slo-mcp

Conversation

@Makisuo

@Makisuo Makisuo commented Nov 6, 2026 •

Copy link
Copy Markdown
Collaborator

Stack: #2293 model, #2294 latency ladder, #2295 compute, #2296 burn alerts, #2297 MCP, #2298 UI

Part 5 of 6: MCP tools for SLOs.

New tools

  • list_slos lists burning SLOs first, then the least budget left. Each row has its SLI, budget left, fastest burn, burning tier, and whether a tier is holding.
  • inspect_slo returns the config, each burn window, each tier's state (breach, hold or clear) and the alerting settings. Its next step is the rule's incident timeline.
  • create_slo, update_slo and delete_slo need alerts:manage. They are marked mutating, so the chat agent asks before running them.

Changes to existing tools

  • list_alert_incidents and get_incident_timeline now point burn-rate incidents at inspect_slo, using the incident's rule id (which survives an SLO rename).
  • inspect_slo accepts an SLO name, an id, slo_…, or its alert rule's alrt_….

Verification

  • slo-tools.test.ts runs the real SlosService on PGlite with a fake warehouse at a 20x burn. It covers list, inspect, create, update and delete, a member being refused, and lookup by rule id.
  • The alert tool hint tests, registry.contract.test.ts and the regenerated tool descriptors pass.

🤖 Generated with Claude Code

list_slos shows each SLO's SLI, budget left and worst burn rate, breaching
tiers first. inspect_slo shows the 5m/30m/1h/6h burn windows, which tier
breaches and the alerting, and points at the rule's incident timeline.
Writes need alerts:manage. Burn-rate incidents in list_alert_incidents and
get_incident_timeline now point at their SLO instead of list_alert_rules.
inspect_slo and list_slos read the evaluator's breach/hold/clear tier state,
so an outage reads as holding, not quiet. Incident hints name the SLO by the
incident's rule id, which survives an SLO rename. Tier text comes from the
tier constants.
@coderabbitai

coderabbitai Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 3 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 178fe1a3-6c91-401e-a640-9fe9ecb26ecf
Commits

Reviewing files that changed from the base of the PR and between fef1f48 and 014926e.

Files ignored due to path filters: 1

  • apps/ai/src/mcp/tool-descriptors.generated.ts is excluded by !**/*.generated.*
Files selected for processing: 15

  • apps/ai/src/mcp/dispatcher.ts
  • apps/ai/src/mcp/lib/slos.ts
  • apps/ai/src/mcp/resources/instructions.ts
  • apps/ai/src/mcp/tools/__tests__/alert-tools.test.ts
  • apps/ai/src/mcp/tools/__tests__/slo-tools.test.ts
  • apps/ai/src/mcp/tools/get-incident-timeline.ts
  • apps/ai/src/mcp/tools/list-alert-incidents.ts
  • apps/ai/src/mcp/tools/mutating.ts
  • apps/ai/src/mcp/tools/registry.ts
  • apps/ai/src/mcp/tools/runtime-requirements.ts
  • apps/ai/src/mcp/tools/slos.ts
  • apps/ai/test/mcp/unimplemented-tool-services.ts
  • packages/domain/src/mcp-outputs/catalog.ts
  • packages/domain/src/mcp-outputs/index.ts
  • packages/domain/src/mcp-outputs/slo.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@maple-review-bot

This comment has been minimized.

P.optionalText reads a blank string as absent, so the empty-string branch
could never run.
@Makisuo

Makisuo commented Nov 6, 2026

Copy link
Copy Markdown
Collaborator Author

F1 fixed: update_slo takes clear_description: true to remove a description, and the unreachable empty-string branch is gone. Covered by a new test that sets a description and then clears it.

@maple-review-bot

This comment has been minimized.

@maple-review-bot

This comment has been minimized.

@maple-review-bot maple-review-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 inline note from Maple's review. The score and summary are in the review comment above.

Comment thread apps/ai/src/mcp/tools/slos.ts Resolved
@maple-review-bot

This comment has been minimized.

@maple-review-bot

This comment has been minimized.

@maple-review-bot

This comment has been minimized.

@maple-review-bot

maple-review-bot Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

Maple review

🟢 Confidence 10/10 · safe to merge. The delta file has no diff versus base and the rest was reviewed with no open findings.
no findings · tests not needed · risk low

No reviewable change remains at this head: the only file listed as updated since the last review, AlertsService.slo.test.ts, is identical to the base (git diff against 2f4e shows no changes), and every other file was reviewed at f955bfe with no finding left open.

Production impact

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

After this merges, Maple checks whether they stop.

014926e · What was checked, coverage and telemetry details are on the Maple / review check. Reply "won't fix" to dismiss a finding, or mention @maple-review-bot to ask about one.

@Makisuo
Makisuo merged commit 1ee8a0d into main Nov 6, 2026
38 checks passed
@Makisuo
Makisuo deleted the feat/slo-mcp branch November 6, 2026 11:36
@maple-review-bot

Copy link
Copy Markdown

Maple: after this shipped

✅ Shipped clean. Nothing this change touches got worse in the hour after it deployed.

Deployed to maple-ai (production) at 2026-11-06 12:32 UTC as f0f3609, the first version after the merge (the merge commit itself never reported). Compared the 60 minutes before and after.

Errors in the changed files:

  • ➖ @maple/mcp/errors/McpQueryError: 0/h → 0/h
  • ➖ @maple/mcp/errors/McpQueryError: 0/h → 0/h
  • ➖ @maple/mcp/errors/McpQueryError: 0/h → 0/h
  • ➖ @maple/mcp/errors/McpQueryError: 0/h → 0/h
  • ➖ @maple/mcp/errors/McpQueryError: 0/h → 0/h
  • ➖ @maple/mcp/errors/McpQueryError: 0/h → 0/h
  • ➖ @maple/mcp/errors/McpQueryError: 0/h → 0/h
  • ➖ @maple/mcp/errors/McpQueryError: 0/h → 0/h
  • ➖ @maple/mcp/errors/McpQueryError: 0/h → 0/h
  • ➖ @maple/mcp/errors/McpQueryError: 0/h → 0/h
Operation Calls/h Errors p95
POST 361 → 0 0.0% → 0.0% 257 → 0 ms
POST 86 → 81 0.0% → 0.0% 573 → 779 ms
GET 52 → 0 5.8% → 0.0% 23625 → 0 ms
GET 8 → 1 0.0% → 0.0% 550 → 897 ms

Maple looks once, an hour after the first deploy that carries the merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant