LearnNewsExamplesServices
Frontmatter
id10132
titleRetire manage_database_backup MCP tools (backup.mjs replaces them)
stateClosed
labels
enhancementaiarchitecture
assigneestobiu
createdAtApr 20, 2026, 9:14 PM
updatedAtApr 20, 2026, 9:41 PM
githubUrlhttps://github.com/neomjs/neo/issues/10132
authortobiu
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtApr 20, 2026, 9:41 PM

Retire manage_database_backup MCP tools (backup.mjs replaces them)

Closed v13.0.0/archive-v13-0-0-chunk-5 enhancementaiarchitecture
tobiu
tobiu commented on Apr 20, 2026, 9:14 PM

Context

PR #10131 shipped buildScripts/ai/backup.mjs — a canonical atomic-bundle orchestrator covering all five persistent AI subsystems (KB, MC memories, MC summaries, MC graph, Concept Ontology, RLAIF trajectories) via the ai/services.mjs SDK boundary, with JSONL artifacts landing under .neo-ai-data/backups/backup-<ISO-ts>/. Validated live 2026-04-20: 6s wall clock, exit 0, all 5 subfolders populated with matching record counts (10,850 KB chunks / 8,204 memories / 794 summaries / 369 graph elements / 2 concepts / 1 trajectories).

With npm run ai:backup now the operator-facing path, the pre-existing MC MCP tool manage_database_backup becomes redundant. And the KB yaml surface added in #10131 was never wired into toolService.mjs — it's present in openapi but not an MCP tool today, only an SDK/Zod surface that backup.mjs does not actually rely on either (makeSafe's no-match passthrough covers the raw-arg flow path).

Reclaims one MCP tool slot from the ~80-tool budget, aligned with the script-over-tool precedent from #9903 and the broader MCP-server → thin wrapper → ai/services/ migration direction.

The Problem

Three pieces of redundant organizational surface:

  1. MC manage_database_backup MCP tool — registered in MC toolService.mjs + openapi. Strictly narrower than backup.mjs.

  2. KB /db/backup/manage openapi entry — yaml surface added in #10131 that was never registered in KB toolService.mjs, so it is not an MCP tool. SDK-surfaced via makeSafe but unused by backup.mjs, which flows raw args through the no-match passthrough.

  3. Parameter addition — the backupPath property added to MC's request schema in #10131 is load-bearing only for Zod forwarding. When the tool is removed entirely, makeSafe no-match passthrough keeps backup.mjs working raw — no functional regression.

The Architectural Reality

Files affected:

  • ai/mcp/server/memory-core/openapi.yaml — remove /db/backup/manage path + BackupActionResponse schema
  • ai/mcp/server/memory-core/services/toolService.mjs — remove manage_database_backup line from serviceMapping (line 26)
  • ai/mcp/server/knowledge-base/openapi.yaml — remove /db/backup/manage path + BackupActionResponse schema (both added in #10131)
  • KB + MC Playwright specs — rename "SDK Zod validation boundary" description to "dispatcher layer" (manual throw fires instead of Zod when no openapi match exists)

Intentionally untouched:

  • ai/mcp/server/{memory-core,knowledge-base}/services/DatabaseService.mjs — service methods remain the authoritative implementation used by backup.mjs via the SDK
  • buildScripts/ai/backup.mjs — continues to call SDK methods; makeSafe no-match passthrough handles raw arg forwarding

The Fix

  1. Delete KB /db/backup/manage openapi path + BackupActionResponse schema (revert the adds from #10131)
  2. Delete MC /db/backup/manage openapi path + BackupActionResponse schema
  3. Delete MC manage_database_backup serviceMapping entry
  4. Rename affected spec test.describe / test name strings to reflect dispatcher-layer rejection instead of Zod-boundary rejection
  5. Re-run affected specs (KB backup, MC backupPath, orchestrator, peer guard) to confirm green
  6. PR against dev

Acceptance Criteria

  • grep -rn 'manage_database_backup' ai/mcp/server/ returns zero results
  • KB_DatabaseService.manageDatabaseBackup and Memory_DatabaseService.manageDatabaseBackup remain callable via ai/services.mjs SDK (backup.mjs unaffected)
  • npm run ai:backup live invocation still emits the full 5-subfolder bundle with matching record counts
  • Spec test names no longer reference "Zod boundary" where the rejection actually happens at the dispatcher layer
  • McpServerToolLimits.spec.mjs is no worse than current state (this ticket does not fix the pre-existing 1161-char failure — that is deferred to the getFullDescription exploration)

Out of Scope

  • getFullDescription exploration — systemic tool-description size reduction, separate ticket
  • ai/services/ migration — thin-wrapper-ification of MCP servers, separate ticket (bigger-picture direction noted by @tobiu 2026-04-20)
  • Restore tooling — still deferred per #10129
  • Retention sweep implementation — still deferred per TODO(#10129) in backup.mjs

Avoided Traps

  • Rejected: keep MC tool for "on-demand agent export" use case. The script path is strictly more capable (atomic bundle across all subsystems); MCP tool covered only MC. Two paths where one is strictly better creates agent decision noise.
  • Rejected: keep KB yaml entry as "documentation-only surface". Yaml drives Zod schemas and MCP registration. Yaml-only-without-registration invites future drift — an agent sees it, assumes it's a tool, wires it without reviewing the removal rationale.

Related

  • Follow-up on #10131 — which added the unused KB yaml surface this ticket reverts
  • Precedent: #9903 — "protect the 100-tool MCP limit" via script-over-tool pattern
  • Test infrastructure: #10041McpServerToolLimits.spec.mjs enforces Anthropic/Gemini per-tool constraints

Origin Session ID: 5a521819-dc75-4549-888e-fcea818d0401

tobiu added the enhancement label on Apr 20, 2026, 9:14 PM
tobiu assigned to @tobiu on Apr 20, 2026, 9:14 PM
tobiu added the ai label on Apr 20, 2026, 9:14 PM
tobiu added the architecture label on Apr 20, 2026, 9:14 PM
tobiu cross-referenced by PR #10133 on Apr 20, 2026, 9:21 PM
tobiu referenced in commit 88d890c - "chore(ai): serialize backup specs for local DX (#10132) on Apr 20, 2026, 9:38 PM
tobiu referenced in commit d289889 - "chore(ai): retire manage_database_backup MCP tools (#10132) (#10133) on Apr 20, 2026, 9:41 PM
tobiu closed this issue on Apr 20, 2026, 9:41 PM
tobiu cross-referenced by #10103 on Apr 20, 2026, 10:04 PM