Skip to main content
Glama

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
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • 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)}"
  • 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()

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Blvckjs96/MemoVault'

If you have feedback or need assistance with the MCP directory API, please join our Discord server