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:
MC manage_database_backup MCP tool — registered in MC toolService.mjs + openapi. Strictly narrower than backup.mjs.
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.
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
- Delete KB
/db/backup/manage openapi path + BackupActionResponse schema (revert the adds from #10131)
- Delete MC
/db/backup/manage openapi path + BackupActionResponse schema
- Delete MC
manage_database_backup serviceMapping entry
- Rename affected spec
test.describe / test name strings to reflect dispatcher-layer rejection instead of Zod-boundary rejection
- Re-run affected specs (KB backup, MC backupPath, orchestrator, peer guard) to confirm green
- PR against dev
Acceptance Criteria
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: #10041 —
McpServerToolLimits.spec.mjs enforces Anthropic/Gemini per-tool constraints
Origin Session ID: 5a521819-dc75-4549-888e-fcea818d0401
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 theai/services.mjsSDK 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:backupnow the operator-facing path, the pre-existing MC MCP toolmanage_database_backupbecomes redundant. And the KB yaml surface added in #10131 was never wired intotoolService.mjs— it's present in openapi but not an MCP tool today, only an SDK/Zod surface thatbackup.mjsdoes 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:
MC
manage_database_backupMCP tool — registered in MCtoolService.mjs+ openapi. Strictly narrower thanbackup.mjs.KB
/db/backup/manageopenapi entry — yaml surface added in #10131 that was never registered in KBtoolService.mjs, so it is not an MCP tool. SDK-surfaced viamakeSafebut unused bybackup.mjs, which flows raw args through the no-match passthrough.Parameter addition — the
backupPathproperty 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/managepath +BackupActionResponseschemaai/mcp/server/memory-core/services/toolService.mjs— removemanage_database_backupline from serviceMapping (line 26)ai/mcp/server/knowledge-base/openapi.yaml— remove/db/backup/managepath +BackupActionResponseschema (both added in #10131)throwfires 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 bybackup.mjsvia the SDKbuildScripts/ai/backup.mjs— continues to call SDK methods; makeSafe no-match passthrough handles raw arg forwardingThe Fix
/db/backup/manageopenapi path +BackupActionResponseschema (revert the adds from #10131)/db/backup/manageopenapi path +BackupActionResponseschemamanage_database_backupserviceMapping entrytest.describe/ test name strings to reflect dispatcher-layer rejection instead of Zod-boundary rejectionAcceptance Criteria
grep -rn 'manage_database_backup' ai/mcp/server/returns zero resultsKB_DatabaseService.manageDatabaseBackupandMemory_DatabaseService.manageDatabaseBackupremain callable viaai/services.mjsSDK (backup.mjs unaffected)npm run ai:backuplive invocation still emits the full 5-subfolder bundle with matching record countsMcpServerToolLimits.spec.mjsis no worse than current state (this ticket does not fix the pre-existing 1161-char failure — that is deferred to thegetFullDescriptionexploration)Out of Scope
getFullDescriptionexploration — systemic tool-description size reduction, separate ticketai/services/migration — thin-wrapper-ification of MCP servers, separate ticket (bigger-picture direction noted by @tobiu 2026-04-20)TODO(#10129)inbackup.mjsAvoided Traps
Related
McpServerToolLimits.spec.mjsenforces Anthropic/Gemini per-tool constraintsOrigin Session ID: 5a521819-dc75-4549-888e-fcea818d0401