memstate_delete
Soft-delete memories by keypath to remove outdated information while preserving full version history. Use this tool to clean up agent memory subtrees or mark memories as no longer relevant.
Instructions
Soft-delete a memory by keypath. Creates a tombstone version preserving full history. The memory can be un-deleted by setting a new value at the same keypath.
USE THIS WHEN: You need to remove outdated or incorrect memories, clean up a keypath subtree, or mark memories as no longer relevant. NOT FOR: Updating content (use memstate_set or memstate_remember to overwrite with new content instead).
memstate_delete(project_id="myapp", keypath="config.old_setting") memstate_delete(project_id="myapp", keypath="config", recursive=true) → deletes config and all children
History is preserved. Use memstate_history to see the deletion in the version chain. Keypath is auto-prefixed.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_id | Yes | Required. Project containing the memory. | |
| keypath | Yes | Required. Keypath to delete (auto-prefixed with 'project.{project_id}.'). | |
| recursive | No | If true, delete the entire keypath subtree. Default: false. |
Implementation Reference
- src/index.ts:139-144 (handler)The memstate MCP server is a proxy that forwards all tool calls, including 'memstate_delete', to a remote MCP server via the 'remote.callTool' method.
server.setRequestHandler(CallToolRequestSchema, async (request) => { return await remote.callTool({ name: request.params.name, arguments: request.params.arguments, }); });