Skip to content

loopover_get_upstream_ruleset has a REST route but no remote MCP tool or local stdio MCP tool #7807

Description

@JSONbored

Context

GET /v1/upstream/ruleset (src/api/routes.ts:2335) returns the latest upstream ruleset snapshot (getLatestUpstreamRulesetSnapshot) — public, unauthenticated, no params, explicitly grouped in the code comment above /v1/finding-taxonomy as "the same class of public static discovery data as /v1/scoring/model and /v1/upstream/ruleset." Its sibling GET /v1/upstream/drift (which embeds loadUpstreamStatus plus recent drift reports) is already exposed as loopover_get_upstream_drift (remote MCP + local stdio). The raw ruleset snapshot itself — genuinely distinct data, not returned by the drift tool's payload — has neither.

Requirements

⚠️ Required pattern — mirror loopover_get_upstream_drift's two-surface shape exactly (src/mcp/server.ts:2330-2337, stdio registration packages/loopover-mcp/bin/loopover-mcp.ts:1916-1923). This tool takes no input (the REST route has zero path/query params) — use an empty/no-argument input schema. No separate human CLI verb exists for upstream-drift either — do not add one here.

  • Register loopover_get_upstream_ruleset as a remote MCP tool in src/mcp/server.ts, no input arguments, calling getLatestUpstreamRulesetSnapshot exactly as the REST route does — including its not-found case (upstream_ruleset_not_found when no snapshot exists yet).
  • Add loopover_get_upstream_ruleset to MCP_TOOL_CATEGORIES as "utility" (the category loopover_get_upstream_drift uses).
  • Register loopover_get_upstream_ruleset as a local stdio MCP tool in packages/loopover-mcp/bin/loopover-mcp.ts, calling GET /v1/upstream/ruleset via apiGet.
  • Do not add a new human-typable CLI verb.
  • Do not change getLatestUpstreamRulesetSnapshot, the REST route, or its (lack of) auth.

Deliverables

  • loopover_get_upstream_ruleset registered as a remote MCP tool in src/mcp/server.ts, category "utility", no-argument input.
  • loopover_get_upstream_ruleset registered as a local stdio MCP tool in packages/loopover-mcp/bin/loopover-mcp.ts.
  • The tool's not-found case (no ruleset snapshot exists yet) 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_upstream_drift's test for the tool-registration shape.

Expected Outcome

loopover_get_upstream_ruleset is reachable via remote MCP and local stdio MCP, matching its existing public REST route — an MCP client can pull the raw upstream ruleset the same way it already can pull the drift report.

Links & Resources

  • src/api/routes.ts:2335 (existing REST route, public/unauthenticated)
  • src/mcp/server.ts:2330-2337, packages/loopover-mcp/bin/loopover-mcp.ts:1916-1923 (the loopover_get_upstream_drift 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