Skip to main content
Glama

memory_cleanup

Remove outdated memories from the documcp server by specifying how many days to retain. Use dry run to preview deletions before executing cleanup.

Instructions

Clean up old memories

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
daysToKeepNoNumber of days of memories to keep
dryRunNoPreview what would be deleted without actually deleting

Implementation Reference

  • Registration of the 'memory_cleanup' tool including its name, description, and input schema definition.
    { name: "memory_cleanup", description: "Clean up old memories", inputSchema: { type: "object", properties: { daysToKeep: { type: "number", description: "Number of days of memories to keep", default: 30, }, dryRun: { type: "boolean", description: "Preview what would be deleted without actually deleting", default: false, }, }, }, },
  • The handler implementation for 'memory_cleanup' tool. Calculates cutoff date based on daysToKeep and delegates to MemoryManager.cleanup() to remove old memories.
    export async function cleanupOldMemories( daysToKeep: number = 30, ): Promise<number> { const manager = await initializeMemory(); const cutoffDate = new Date(Date.now() - daysToKeep * 24 * 60 * 60 * 1000); return await manager.cleanup(cutoffDate); }

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/tosin2013/documcp'

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