Skip to main content
Glama

memory_stats

Return health statistics for the memory store to monitor memory growth, identify dormant memories, and get per-namespace breakdowns of counts and confidence.

Instructions

Return health statistics for the memory store. Use to monitor memory growth, identify dormant memories, and get a per-namespace breakdown of counts and confidence distribution. Call at session start alongside memory_context to assess the state of the knowledge base.

stats.dormant_count reports memories untouched for 90+ days — a resting signal only, never a confidence change. Dormant memories wake automatically on recall via spreading activation. Memory is never auto-forgotten.

review_limit raises the review.sample, claims.sample and graph.orphan_sample caps (default 5, max 100) so a reconciliation sweep can enumerate every flagged memory — pair with memory_search's ids parameter to pull the full bodies.

stats.graph.orphan_sample names the memories behind graph.orphans: those no relation touches, which spreading activation can never reach. Ordered by confidence, then access count, then recency, so the orphans costing the most retrieval come first, each row carrying its namespace. memory_search(orphans=True) pulls the same set with full bodies; memory_relate reconnects one — where a directional fact genuinely exists.

stats.claims is the state-claim backlog: memories still asserting a PR/MR is open. claims.sample enumerates them, contradicted first, each row tagged contradicted (a later memory in the same namespace already recorded that ref as resolved). open counts every unresolved claim while open_actionable — what the sample lists — excludes claims on deprecated memories. memory_search(claims="open") pulls the same set with full bodies; memory_update(resolve_claims=...) closes them without editing prose.

claims.unverified counts refs a memory names without ever saying what became of them. It is reported for visibility, not action: those refs assert nothing, so they are excluded from open and from sample on purpose. Read them with memory_search(claims="unverified").

flag_stale is deprecated and ignored — auto-demotion to stale contradicted the never-forget model and has been removed. Retained so existing callers do not error. namespace scopes the stats to a single namespace; omit for global.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
namespaceNo
flag_staleNo
review_limitNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.13.0
    • addedInput schema / properties / review_limit
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "integer"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Review Limit"
      +}
  2. First observedv0.3.1

TDQS

A5/5.0
Behavior5/5

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

With no annotations provided, the description carries the full burden and succeeds: it discloses non-obvious behaviors such as no auto-forgetting, dormant memories waking via spreading activation, deprecated flag_stale being ignored, and the semantics of review_limit. It also clarifies that dormant_count is 'a resting signal only, never a confidence change.'

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 text is long but every paragraph earns its place by explaining a distinct output field or parameter. It front-loads the primary purpose and usage, then uses scannable backticked identifiers and blank-line separation between semantic sections. No filler or tautology.

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

Completeness5/5

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

With no output schema and no annotations, the description must document the return semantics itself. It covers dormant counts, orphans, claims backlog, unverified refs, and namespace scoping, and even notes which memory_search queries return the same sets. This is complete enough for an agent to invoke and interpret the tool correctly.

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

Parameters5/5

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

Schema description coverage is 0%, so the description must explain all three parameters. It does: namespace scopes stats or is global when omitted; flag_stale is deprecated and ignored; review_limit raises the review/claims/orphan sample caps with default and max values. This fully compensates for the sparse schema.

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 opens with a specific verb and resource: 'Return health statistics for the memory store.' It immediately lists concrete use cases (monitor memory growth, identify dormant memories, per-namespace breakdown) and is clearly distinct from siblings like memory_search and memory_context, which are referenced as complements rather than synonyms.

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?

The description gives explicit when-to-use guidance: 'Call at session start alongside memory_context to assess the state of the knowledge base.' It also names sibling alternatives for related actions (memory_search for bodies, memory_relate for reconnecting, memory_update for closing claims), providing clear context for when to use the stats tool versus delegating to another tool.

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