Repository navigation
feat(api): clickstack_get_slo MCP tool - #3799
alex-fedotyev wants to merge 2 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Duplicate code analysis1 new clone introduced by this PR.
If one of these duplicates a helper that already exists, import it instead jscpd compared this branch against |
E2E Test Results✅ All tests passed • 475 passed • 1 skipped • 1128s
Tests ran across 4 shards in parallel. |
Adds an MCP tool to read SLOs, registered only when SLOs are enabled. Without an ID it lists every SLO as a summary from its stored status (state, SLI, budget left, burn rate and the state of each burn alert), optionally filtered by state. With an ID it returns the definition, the status computed when asked (falling back to the stored one if that fails), the alerts' states and a SQL where clause that selects the bad events, ready for clickstack_search. For a grouped SLO, the status has each group's numbers, and a group can be passed to scope the bad events to it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
d524e13 to
1e2b40e
Compare
|
🔵 Tier 2 — Low RiskSmall, isolated change with no API route or data model modifications. Why this tier:
Review process: AI review + quick human skim (target: 5–15 min). Reviewer validates AI assessment and checks for domain-specific concerns. Stats
|
PR Review
4 finding(s): 🔴 0 P0/P1 · 🟡 3 P2 · 🔵 1 P3 None could be anchored to changed lines; they are listed below. 1 P3 folded at the bottom. Findings outside the changed lines
🔵 1 P3 — no action needed before merge
Priority comes from a separate grading pass over the finished review. P3 is folded here instead of posted inline. No finding blocks merge automatically; a maintainer decides. |
Deep Review✅ No critical (P0/P1) issues found. The tool is read-only, team-scoped on every path, and the user-supplied 🟡 P2 — recommended
🔵 P3 nitpicks (8)
Reviewers (12): correctness, testing, maintainability, project-standards, agent-native, learnings-researcher, security, api-contract, reliability, adversarial, kieran-typescript, performance. Testing gaps:
Notes: Project-standards found no violations (MCP.md row, feature-flag gating, No finding blocks merge automatically. A maintainer will expect P0/P1 findings in code this PR changes to be fixed; P2/P3 are your call -- fix or reply. Never fix findings about surrounding code here; reply instead. Do not widen the PR. How to respond |
Summary
Adds an MCP tool to read SLOs, registered only when SLOs are enabled.
Without an ID it lists every SLO as a summary from its stored status (state,
SLI, budget left, burn rate and the state of each burn alert), optionally
filtered by state. With an ID it returns the definition, the status
computed when asked (falling back to the stored one if that fails), the
alerts' states and a SQL where clause that selects the bad events, ready
for clickstack_search. For a grouped SLO, the status has each group's
numbers, and a group can be passed to scope the bad events to it.
Stack
Part 12 of 27 PRs in a GitHub stack (stack #3815). The header says this PR merges into the branch below it, but the stack's base is
main: merging a PR lands it and every PR below it onmain, one squashed commit each. Each diff is only its own change, and CI runs as if each PR targetsmain.Parts 1 to 6 are shared code, 7 to 13 the API and its MCP tools, and 14 to 27 the app. Everything ships behind
ENABLE_SLOS(API) andNEXT_PUBLIC_ENABLE_SLOS(app), both off by default.How to reproduce
Starting point: a checkout of this branch with Docker (
make dev-intstarts ClickHouse and Mongo for the integration tests).On
main: nothing to compare; this is new code.On this branch:
cd packages/api && npx jest src/mcp/__tests__/slos.test.ts: the tool registers only with SLOs on; it lists summaries by state, returns one SLO with its live status (or the stored one when computing fails), the bad-events where clause, and a group's scope.Test plan
mcp/__tests__/slos.test.ts; all MCP unit testsHow to test on Vercel preview
N/A, non-UI change.
References
[no-changeset: allow] The changeset for this piece is in part 13.
[as-cast: allow] The cast check matches the word "as" in comments and strings here; the diff has no
ascasts.