Skip to main content
Glama

create_backup

Create a backup of the current memory state to preserve knowledge graph data for remote storage and collaboration.

Instructions

현재 메모리 상태의 백업을 생성합니다

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
backupNameNo백업 이름 (선택사항)

Implementation Reference

  • The handler function that executes the create_backup tool logic: generates a timestamped backup of the memory graph, serializes it to JSON, and uploads it to GitHub as a new file in the backups directory.
    private async handleCreateBackup(args: any) { try { const timestamp = new Date().toISOString().replace(/[:.]/g, '-'); const backupName = args.backupName || `backup-${timestamp}`; const backupPath = `backups/${backupName}.json`; const currentData = this.memoryManager.toJSON(); const backupContent = JSON.stringify({ ...currentData, backupInfo: { createdAt: new Date().toISOString(), name: backupName, originalPath: 'memory/graph.json' } }, null, 2); await this.githubClient.putFile( { path: backupPath, content: backupContent, }, `backup: Create backup '${backupName}'` ); return { content: [{ type: 'text', text: JSON.stringify({ success: true, message: `Backup created successfully`, backupName, backupPath, timestamp: new Date().toISOString() }, null, 2), }], }; } catch (error) { return { content: [{ type: 'text', text: JSON.stringify({ success: false, error: error instanceof Error ? error.message : 'Unknown error' }, null, 2), }], }; } }
  • Input schema for the create_backup tool, defining an optional 'backupName' string parameter.
    inputSchema: { type: 'object', properties: { backupName: { type: 'string', description: '백업 이름 (선택사항)' } }, },
  • src/index.ts:346-358 (registration)
    Registration of the create_backup tool in the server's tool list for ListToolsRequestSchema, including name, description, and input schema.
    { name: 'create_backup', description: '현재 메모리 상태의 백업을 생성합니다', inputSchema: { type: 'object', properties: { backupName: { type: 'string', description: '백업 이름 (선택사항)' } }, }, },
  • src/index.ts:410-411 (registration)
    Dispatch case in the CallToolRequestSchema handler that routes 'create_backup' calls to the handleCreateBackup method.
    case 'create_backup': return await this.handleCreateBackup(args);

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/YeomYuJun/remote-memory-mcp-server'

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