Skip to main content
Glama

Db Maintenance

db_maintenance

Compacts the database to reclaim unused space, updates query planner statistics, and demotes stale hot memories when auto-demote is enabled.

Instructions

Run database maintenance (vacuum, analyze, auto-demote stale).

Compacts the database to reclaim unused space, updates query planner statistics, and demotes stale hot memories (if auto_demote is enabled).

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "db_maintenance"
  }
}

Input Schema

NameRequiredDescriptionDefault

No arguments

Output Schema

NameRequiredDescriptionDefault
memory_countYes
vector_countYes
schema_versionYes
bytes_reclaimedYes
auto_demoted_idsNo
size_after_bytesYes
size_before_bytesYes
auto_demoted_countNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.8.0

TDQS

B3.4/5.0
Behavior3/5

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

With no annotations supplied, the description carries the full burden. It does disclose the mutating effects — compaction and demotion of stale hot memories — which is meaningful context about what changes. However, it omits operational characteristics an agent needs before firing a maintenance job: whether it blocks or is expensive, whether it is safe to run concurrently, and whether demoted memories can be restored with 'promote'.

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?

Two tight sentences with no filler: the operation and its sub-steps come first, with the conditional demotion caveat attached to the relevant clause. Nothing could be removed without losing information.

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

Completeness3/5

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

An output schema exists, so return values need not be explained, and a zero-parameter maintenance job is inherently simple. Still missing is the operational context that matters most for an unattended job — cost, duration, and whether re-running demoted memories is possible — leaving the definition adequate but incomplete relative to the tool's side effects.

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 takes zero parameters, so there is no parameter meaning to add; the baseline of 4 applies. Nothing in the description conflicts with the empty schema.

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

Purpose4/5

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

The description names a specific verb and resource and enumerates the three concrete effects (reclaiming space, updating planner statistics, demoting stale hot memories), which implicitly separates it from single-item tools like 'demote' and read-only tools like 'memory_stats'. It does not explicitly name or route against any sibling, so it stops just short of a 5.

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?

There is no when-to-use guidance at all: no indication of how often maintenance should run, no prerequisite conditions, and no advice on when to prefer this over the granular 'demote' or 'forget' tools. The only conditional mentioned ('if auto_demote is enabled') describes internal behavior, not invocation guidance.

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