Skip to main content
Glama
mixelpixx

meMCP - Memory-Enhanced Model Context Protocol

memory_backup

Backup memory data from the meMCP server to preserve LLM knowledge and session context for future retrieval and continuity.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Direct registration of the 'memory_backup' tool using server.registerTool, defining schema and handler.
    registerBackupTool(server) {
      server.registerTool(
        'memory_backup',
        'Create a backup of the memory system',
        {
          type: 'object',
          properties: {
            backupName: {
              type: 'string',
              description: 'Name for the backup (optional - will generate if not provided)',
            },
            includeIndexes: {
              type: 'boolean',
              description: 'Include search indexes in backup',
              default: true,
            },
          },
        },
        async (args) => {
          return await this.handleBackup(args);
        }
      );
    }
  • JSON schema for input parameters of memory_backup tool.
    {
      type: 'object',
      properties: {
        backupName: {
          type: 'string',
          description: 'Name for the backup (optional - will generate if not provided)',
        },
        includeIndexes: {
          type: 'boolean',
          description: 'Include search indexes in backup',
          default: true,
        },
      },
    },
  • Primary handler function invoked by the tool registration. Processes args, calls createBackup helper, and returns MCP-formatted response.
    async handleBackup(args) {
      try {
        const { backupName, includeIndexes = true } = args;
        const timestamp = new Date().toISOString().replace(/[:.]/g, '-');
        const finalBackupName = backupName || `backup-${timestamp}`;
        
        const backupResult = await this.createBackup(finalBackupName, includeIndexes);
        
        return {
          content: [
            {
              type: 'text',
              text: `💾 **Backup Created Successfully**\n\n**Name:** ${backupResult.name}\n**Facts:** ${backupResult.factCount}\n**Size:** ${backupResult.size}\n**Location:** ${backupResult.path}\n**Includes Indexes:** ${includeIndexes ? 'Yes' : 'No'}`,
            },
          ],
        };
      } catch (error) {
        return {
          content: [
            {
              type: 'text',
              text: `Error creating backup: ${error.message}`,
            },
          ],
          isError: true,
        };
      }
    }
  • Helper method that performs the backup operation by fetching stats and returning metadata (stubbed implementation).
    async createBackup(backupName, includeIndexes = true) {
      try {
        const stats = await this.factStore.getStats();
        
        return {
          name: backupName,
          factCount: stats.totalFacts,
          size: 'N/A', 
          path: `backups/${backupName}`,
          timestamp: new Date().toISOString(),
          includeIndexes,
        };
      } catch (error) {
        throw new Error(`Failed to create backup: ${error.message}`);
      }
  • Higher-level registration in MemoryTools that invokes MemoryManagement.registerTools(server), enabling the memory_backup tool.
    async registerTools(server) {
      // Register tools from modular components
      this.operations.registerTools(server);
      this.queryHandler.registerTools(server);
      this.streamingTools.registerTools(server);
      this.management.registerTools(server);
    }

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/mixelpixx/meMCP'

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