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);
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. 'Clean up' suggests a destructive operation, but it doesn't clarify permissions needed, whether deletions are permanent, rate limits, or what happens to cleaned memories. The dryRun parameter hints at preview capability, but the description itself lacks explicit warnings or behavioral details.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise with just three words, which is efficient and front-loaded. However, it borders on under-specification given the tool's potential complexity. Every word earns its place, but more context could improve clarity without sacrificing brevity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with no annotations, no output schema, and a potentially destructive operation, the description is inadequate. It doesn't explain what 'memories' are, how cleanup affects the system, or what the tool returns. Given the context of sibling tools and the action's implications, more completeness is needed for safe and effective use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so parameters are fully documented in the schema. The description adds no additional meaning beyond implying 'old' relates to time-based retention. Since the schema handles parameter details, a baseline score of 3 is appropriate, as the description doesn't compensate but doesn't detract either.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Clean up old memories' states a clear action (clean up) and resource (memories), but is vague about what constitutes 'old' and doesn't distinguish this tool from sibling tools like 'memory_pruning' or 'cleanup_agent_artifacts'. It provides basic purpose but lacks specificity about scope or differentiation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives like 'memory_pruning' or 'cleanup_agent_artifacts'. The description implies usage for removing old memories but offers no context about prerequisites, timing, or exclusions. This leaves the agent with minimal direction.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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