Skip to content

loopover_get_live_gate_thresholds has a REST route but no remote MCP tool or local stdio MCP tool #7801

Description

@JSONbored

Context

GET /v1/repos/:owner/:repo/live-gate-thresholds (src/api/routes.ts:3440) is the "AMS probe surface for live gate thresholds" — a field-limited snake_case view of the currently-authoritative gate override (live row wins, shadow fills in if live is absent; 404 when neither exists). Its own comment says "[a]uth matches gate-config/effective above," i.e. the same requireStaticProtectedApiToken + isMcpReadRepoAllowed pattern loopover_get_pr_reviewability already uses as an MCP tool. Like gate-config/effective, this route has no remote MCP tool and no local stdio MCP tool.

Requirements

⚠️ Required pattern — mirror loopover_get_pr_reviewability's auth handling and two-surface shape (src/mcp/server.ts:2350-2358, stdio registration packages/loopover-mcp/bin/loopover-mcp.ts:1427-1434). Input is owner/repo only (ownerRepoShape) — no pull number. No separate human CLI verb exists for reviewability either — do not add one here. This tool's REST route can 404 (live_gate_thresholds_not_found) — the MCP tool must propagate that as a normal "not found" result, not throw, matching how other 404-capable tools in this file already handle it (e.g. loopover_get_issue_quality's not-found handling — check its pattern before inventing a new one).

  • Register loopover_get_live_gate_thresholds as a remote MCP tool in src/mcp/server.ts, input ownerRepoShape, calling toLiveGateThresholdFields(authoritativeGateOverride(live, shadow)) exactly as the REST route does, including its not-found case.
  • Add loopover_get_live_gate_thresholds to MCP_TOOL_CATEGORIES as "maintainer".
  • Register loopover_get_live_gate_thresholds as a local stdio MCP tool in packages/loopover-mcp/bin/loopover-mcp.ts, calling GET ${repoBase}/live-gate-thresholds via apiGet.
  • Do not add a new human-typable CLI verb.
  • Do not change toLiveGateThresholdFields, authoritativeGateOverride, the REST route, or its auth gate.

Deliverables

  • loopover_get_live_gate_thresholds registered as a remote MCP tool in src/mcp/server.ts, category "maintainer", input ownerRepoShape.
  • loopover_get_live_gate_thresholds registered as a local stdio MCP tool in packages/loopover-mcp/bin/loopover-mcp.ts.
  • The tool's not-found case (no live or shadow override) is handled as a normal result, not an unhandled throw.
  • No new REST route and no new human CLI verb.

Test Coverage Requirements

src/mcp/server.ts and packages/loopover-mcp are both under the 99%+ Codecov patch gate — cover both the found and not-found branches. Mirror loopover_get_pr_reviewability's test for the found case, and an existing 404-capable tool's test (e.g. loopover_get_issue_quality) for the not-found case. Verify packages/loopover-mcp's coverage.include scoping before assuming the src/** gate applies identically.

Expected Outcome

loopover_get_live_gate_thresholds is reachable via remote MCP and local stdio MCP with the same auth boundary and not-found behavior its REST route already has.

Links & Resources

  • src/api/routes.ts:3440 (existing REST route)
  • src/mcp/server.ts:2350-2358, packages/loopover-mcp/bin/loopover-mcp.ts:1427-1434 (the loopover_get_pr_reviewability pattern to mirror)
  • src/mcp/server.ts:1798-1890 (MCP_TOOL_CATEGORIES map)

Metadata

Metadata

Assignees

No one assigned

    Labels

    gittensor:featureGittensor-scored feature linked to a feature issue — scores a 0.25x multiplier.help wantedExtra attention is needed

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions