Skip to main content
Glama

run_cleanup

Removes stale data: demotes unused hot memories, expires old mining patterns, deletes outdated logs, and applies retention policies to delete stale memories.

Instructions

Run comprehensive cleanup of stale data.

Performs all cleanup operations in one call:

  • Demotes stale hot memories (not accessed in demotion_days)

  • Expires old pending mining patterns (30+ days without activity)

  • Deletes old output logs (based on log_retention_days)

  • Deletes stale memories by type-specific retention policies

Use this periodically to keep the database lean. For just database compaction, use db_maintenance() instead.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior4/5

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

No annotations are provided, so the description carries full burden. It discloses destructive actions (demotions, deletions, expirations) clearly. However, it does not explicitly mention that operations are irreversible or caution about potential data loss, leaving some behavioral ambiguity.

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

Conciseness5/5

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

The description is concise and well-structured: a one-sentence summary, a bulleted list of actions, and a usage note referencing an alternative. Every sentence adds value with no redundant information.

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

Completeness4/5

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

Given an output schema exists, the description does not need to explain return values. It covers the tool's scope, operations, and differentiation from siblings. However, it omits potential side effects like performance impact or locking during cleanup, which could be relevant for an agent.

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

Parameters4/5

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

The tool has zero parameters, and the input schema is empty. Baseline is 4 per instructions. The description adds no parameter-specific meaning, but this is unnecessary given no parameters. The listed operations effectively explain what the tool does.

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

Purpose5/5

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

The description clearly states the tool's purpose: comprehensive cleanup of stale data. It lists specific operations (demote, expire, delete) and distinguishes itself from the sibling tool db_maintenance, which is for database compaction only.

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

Usage Guidelines5/5

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

Explicitly recommends periodic use for keeping the database lean and advises using db_maintenance for compaction only. This provides clear when-to-use and when-not-to-use guidance.

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/michael-denyer/memory-mcp'

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