LearnNewsExamplesServices
Frontmatter
id12824
titleRemove the destructive delete_all_summaries MCP tool
stateClosed
labels
enhancementaiarchitecture
assigneesneo-fable
createdAtJun 9, 2026, 7:13 PM
updatedAtJun 11, 2026, 12:27 AM
githubUrlhttps://github.com/neomjs/neo/issues/12824
authorneo-opus-grace
commentsCount2
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtJun 11, 2026, 12:27 AM

Remove the destructive delete_all_summaries MCP tool

Closed v13.0.0/archive-v13-0-0-chunk-17 enhancementaiarchitecture
neo-opus-grace
neo-opus-grace commented on Jun 9, 2026, 7:13 PM

Context

Noticed while diagnosing the session-summary backlog (2026-06-09): the Memory Core MCP server exposes a delete_all_summaries tool that wipes session summaries. A mass-destructive operation on the agent-callable MCP surface is a footgun — especially as the summarization pipeline (turn mini-summaries + session summaries) becomes load-bearing for v13.

The Problem

  • Any agent with Memory Core MCP access can call delete_all_summaries and destroy the SESSION_SUMMARY corpus the pipeline spends gemma4 cycles building.
  • The {confirmation} string arg is weak protection on a tool that is agent-callable by construction; it does not gate against an agent that simply supplies the confirmation.
  • There is no legitimate agent-facing reason to bulk-delete summaries at runtime. The destructive surface belongs off the MCP tool list.

The Architectural Reality

  • ai/mcp/server/memory-core/toolService.mjs:19 — the MCP tool binding: delete_all_summaries: SummaryService.deleteAllSummaries.bind(SummaryService).
  • ai/mcp/server/memory-core/openapi.yaml:487operationId: delete_all_summaries (schema loaded into every agent's context at tool-enumeration — per-agent context-tax).
  • ai/services/memory-core/SummaryService.mjs:145async deleteAllSummaries({confirmation}) impl.
  • The method is NOT orphaned (corrected via @neo-opus-ada /peer-role; V-B-A'd repo-wide). It is exercised by test/playwright/unit/ai/services/memory-core/SummaryService.TenantIsolation.spec.mjs (L133/164/178/300) — the #10000/#10128 multi-tenant safety guard: in cloud mode the delete scopes to the active tenant (collection.delete({where:{userId}}), NOT collection.drop()), and does NOT remove SHARED_USER_ID-tagged rows (asymmetric scope). Also referenced by learn/agentos/MemoryCore.md, learn/agentos/tooling/MemoryCoreMcpApi.md, and ROADMAP.md:24. The original AC#3 ai/-scoped grep was the blind spot that mis-classified it as orphaned.

The Fix (shape A — un-expose, do not delete)

  • Remove the delete_all_summaries binding from toolService.mjs:19.
  • Remove the delete_all_summaries operation from openapi.yaml:487 (also trims per-agent context-tax).
  • KEEP SummaryService.deleteAllSummaries + its TenantIsolation.spec coverage — it is a tested, tenant-safe scoped-delete primitive, and is exactly the safe-delete primitive the #12830 gated corrupted-memory cleanup will reuse. It is simply no longer reachable via the agent MCP surface.
  • Update docs that advertise the MCP tool: remove the tool entry from learn/agentos/MemoryCore.md + learn/agentos/tooling/MemoryCoreMcpApi.md; keep the ROADMAP.md:24 mention of the tenant-safe method.

Contract Ledger

Surface Source of Authority Proposed Fallback Consumer
delete_all_summaries MCP tool toolService.mjs:19 + openapi.yaml:487 REMOVE (un-expose) operator script behind DestructiveOperationGuard if an agent-facing need ever arises agents
SummaryService.deleteAllSummaries() SummaryService.mjs:145 KEEP (tenant-safe primitive; live #10000/#10128 test) n/a internal/programmatic + future #12830 cleanup
SummaryService.TenantIsolation.spec the spec file KEEP (security regression guard) n/a CI

Acceptance Criteria

  • delete_all_summaries binding removed from toolService.mjs and operation removed from openapi.yaml.
  • SummaryService.deleteAllSummaries method retained; SummaryService.TenantIsolation.spec.mjs retained and green (the #10000/#10128 tenant-safety guard is preserved).
  • Repo-wide reference check (NOT ai/-scoped): grep -rn "delete_all_summaries" --include="*.mjs" --include="*.yaml" . → no MCP binding/operation references remain; the deleteAllSummaries method + its test still present.
  • Docs updated: the delete_all_summaries MCP-tool entry removed from learn/agentos/MemoryCore.md + learn/agentos/tooling/MemoryCoreMcpApi.md; ROADMAP.md:24 tenant-safe-method mention retained.
  • MC MCP tool list no longer advertises delete_all_summaries; tool-count specs updated + green.

Out of Scope

  • Removing the underlying deleteAllSummaries method (it is a tested tenant-safety primitive; only the MCP surface is un-exposed).
  • Auditing OTHER Memory Core MCP tools for destructive surface (worth a follow-up sweep; not this ticket).

Avoided Traps

  • Gating behind a stronger confirmation instead of removing — rejected: any confirmation an agent can pass is not a guard; the operation should not be on the agent MCP surface.
  • Deleting the method as "orphaned" — falsified by @neo-opus-ada /peer-role (V-B-A'd repo-wide): the method backs the #10000/#10128 multi-tenant safety regression test + docs + ROADMAP. An ai/-scoped grep missed them. Un-expose the MCP tool; keep the tested method.

Decision Record impact

none directly; preserves the #10000/#10128 multi-tenant tenant-safe-delete behavior (must not regress it).

Related

  • #10000 / #10128 — multi-tenant identity + the tenant-safe deleteAllSummaries scoping this ticket must preserve.
  • #12830 — corrupted-memory cleanup; its gated delete will reuse the tenant-safe scoped-delete primitive this ticket keeps.
  • #12820 — the session-summary corpus this protects (builds-adjacent).
  • #12778 — same runtime-safety theme.

Origin Session ID: 0f94aade-f9b1-4214-b17e-be0bdf33e2be Reshaped per @neo-opus-ada /peer-role (shape A) — Session 2feb15b9-1948-4553-9679-1419ed7eecf1. Retrieval Hint: "delete_all_summaries un-expose MCP tool keep tenant-safe deleteAllSummaries method TenantIsolation spec"

tobiu
tobiu Jun 10, 2026, 9:06 PM

@neo-opus-grace @neo-opus-ada My take would be to remove the MCP tool (binding). keeping the logic itself is fine, just exposing it is definitely not.

  • 2026-06-10T21:46:31Z @neo-fable assigned to @neo-fable
  • 2026-06-10T21:49:46Z @neo-fable cross-referenced by PR #12870
  • 2026-06-10T22:23:28Z @neo-fable cross-referenced by PR #12871
tobiu referenced in commit c241834 - "fix(memory-core): un-expose the destructive delete_all_summaries MCP tool (#12824) (#12870) on Jun 11, 2026, 12:27 AM
tobiu closed this issue on Jun 11, 2026, 12:27 AM