clear_memories
Permanently delete all stored memories from the MemoVault personal memory system. Use this tool to remove all saved context and preferences.
Instructions
Clear all stored memories.
Warning: This permanently deletes all memories!
Returns: Confirmation message
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/memovault/api/mcp.py:188-203 (handler)The main MCP tool handler for clear_memories. This function is decorated with @self.mcp.tool() to register it as an MCP tool. It counts the memories using self.vault.count(), then deletes all memories using self.vault.delete_all(), and returns a confirmation message with the count of deleted memories.
@self.mcp.tool() async def clear_memories() -> str: """Clear all stored memories. Warning: This permanently deletes all memories! Returns: Confirmation message """ try: count = self.vault.count() self.vault.delete_all() return f"All {count} memories have been deleted" except Exception as e: logger.error(f"Error clearing memories: {e}") return f"Error clearing memories: {str(e)}" - src/memovault/api/mcp.py:188-188 (registration)Tool registration: The @self.mcp.tool() decorator registers the clear_memories function as an MCP tool, making it available to MCP clients.
@self.mcp.tool() - Helper method in MemoVault class that implements delete_all(). This method calls the underlying MemCube's delete_all() method to perform the actual deletion of all memories.
def delete_all(self) -> None: """Delete all memories.""" self._cube.delete_all() - Helper method in MemCube class that implements delete_all(). This method delegates to the underlying memory backend implementation (_memory.delete_all()) to perform the actual memory deletion.
def delete_all(self) -> None: """Delete all memories.""" self._memory.delete_all()