Skip to main content
Glama

sleep

Run background memory maintenance when idle to consolidate ripe duplicate clusters and prune or re-affirm the memory budget, keeping recall fast. Idempotent; no work until ripe.

Instructions

SLEEP-TIME COMPUTE: call this whenever the agent is IDLE to run background memory maintenance in one idempotent pass — the expensive reorganization the write path defers. It consolidates any ripe near-duplicate clusters (dedup + preference-flip handling), and, if keep is given (or a capacity was configured), prunes/re-affirms the memory budget. It changes nothing until something is ripe, but each call clusters every active record (under a minute at 60,000), so call it on a long idle, not on every tick; a second immediate call does no new work; it never edits raw text. This is the recommended place to do heavy cleanup so remember()/recall() stay fast.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keepNo
cluster_thresholdNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.6/5.0
Behavior5/5

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

With no annotations supplied, the description carries the full burden and does so thoroughly: it describes idempotence, deferred/ripe-dependent behavior, cluster consolidation with preference-flip handling, budget pruning/re-affirmation, performance cost (under a minute at 60,000 records), and the fact that it never edits raw text.

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 dense but well structured: it front-loads the core action and idle-time trigger, then layers in conditional behavior, performance cost, idempotence, and limitations. Every sentence provides operational value for deciding whether to call the tool.

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?

For a complex background maintenance tool with no output schema, the description covers purpose, timing, side effects, idempotence, and performance. The main gap is that `cluster_threshold` receives no semantic explanation, which is notable given 0% schema description coverage.

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 coverage is 0%, so the description must compensate. It explains `keep` as triggering pruning/re-affirmation of the memory budget only when provided or when capacity is configured, but it never mentions `cluster_threshold`, leaving the parameter’s default of 15 and effect unexplained.

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 states a specific maintenance operation: an idempotent sleep-time compute pass that consolidates ripe near-duplicate clusters and prunes/re-affirms the memory budget. It distinguishes itself from recall/remember by being the recommended place for heavy cleanup so those tools stay fast, and it clarifies what it does not do (never edits raw text).

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?

It gives explicit timing guidance: call whenever the agent is idle, preferably on a long idle rather than every tick, and notes that a second immediate call does no new work. It also explains the conditional effect of `keep` and positions this as the recommended heavy-cleanup path, making the when/when-not conditions clear.

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

Deploy Server

Other Tools