Skip to main content
Glama

Brain maintenance

crbro_maintenance
DestructiveIdempotent

Run brain housekeeping: recalculate heat, prune weak synapses, check integrity, and rebuild the search index, returning a report of issues and repairs.

Instructions

Write: brain housekeeping — recalculate heat, prune weak synapses, check integrity, rebuild the search index. Returns a report (counts, integrity_issues, repairable, notes) and flags debts without a revisit trigger. dry_run:true writes nothing at all (the global map is computed live, never cached). Extras are OFF unless asked: archive cold neurons (on a mature brain most look cold, and archived ones stop being searchable), unarchive them back, purge_boilerplate left by early miners, repair what the integrity check found, backfill_dates for entries older than 1.13, compact what a bulk import left. For session close use crbro_consolidate; to only read the brain use crbro_inspect.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
repairNoFix what the integrity check found: dangling connection ids, synapse files pointing at missing neurons, entry_dates/entry_status keys with no live entry, manifest counters. Off in dry_run; the report lists repairs[] one line each.
archiveNoAlso move cold neurons (heat < 0.05, untouched 90+ days) out of the cortex into archives/. Off by default; run dry_run first and read archivable_neurons. Undo with unarchive.
compactNoFold the one-line neurons a bulk import left (compact_groups: 25+ born the same day in one domain, no tags, links or summary, 30+ days old) into one digest neuron per group. Identical lines are kept once, each source name becomes search keys of its line, every source is copied to quarantine first. Shared neurons are never touched. Off in dry_run — run that first and read the samples.
dry_runNotrue = report only: no heat recalc, archiving, unarchiving, purge, repair, lock sweep, pruning or index rebuild, and no file written. Counts, debts and integrity checks still run.
unarchiveNoMove these neuron ids (or "all") from archives/ back into the cortex and reindex them. Off in dry_run; the report says archives_count and unarchived_neurons; unknown ids are listed in notes.
backfill_datesNoDate the patterns, preferences, errors and debts written before 1.13 (recall shows them with an empty matched_added), using only a date stated in the text of the entry itself, to the day; the rest stay undated — nothing is guessed. Every run reports undated_entries and datable_entries; this writes them (dates_backfilled). Off in dry_run.
purge_boilerplateNoAlso delete contentless facts left by early miner versions ("Referenced in: file.md"). Off by default; every run reports how many there are. Neurons left empty are kept.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv2.5.1
    • addedInput schema / properties / backfill_dates
      Added value: +{
      +  "description": "Date the patterns, preferences, errors and debts written before 1.13 (recall shows them with an empty matched_added), using only a date stated in the text of the entry itself, to the day; the rest stay undated — nothing is guessed. Every run reports undated_entries and datable_entries; this writes them (dates_backfilled). Off in dry_run.",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / compact
      Added value: +{
      +  "description": "Fold the one-line neurons a bulk import left (compact_groups: 25+ born the same day in one domain, no tags, links or summary, 30+ days old) into one digest neuron per group. Identical lines are kept once, each source name becomes search keys of its line, every source is copied to quarantine first. Shared neurons are never touched. Off in dry_run — run that first and read the samples.",
      +  "type": "boolean"
      +}
  2. Changed1 schema field changedv2.4.0
    • removedInput schema / $schema
      Removed value: -"http://json-schema.org/draft-07/schema#"
  3. Changed4 schema fields changedv2.0.0
    • changedInput schema / properties / archive / description
      Previous value: -"Also move cold neurons (heat < 0.05, untouched 90+ days) out of the cortex. Off by default; run dry_run first and read archivable_neurons. Restore by moving the file from archives/ back into cortex/."New value: +"Also move cold neurons (heat < 0.05, untouched 90+ days) out of the cortex into archives/. Off by default; run dry_run first and read archivable_neurons. Undo with unarchive."
    • changedInput schema / properties / dry_run / description
      Previous value: -"true = report only: no heat recalc, archiving, purge, lock sweep, pruning or index rebuild. Counts, debts and integrity checks still run."New value: +"true = report only: no heat recalc, archiving, unarchiving, purge, repair, lock sweep, pruning or index rebuild, and no file written. Counts, debts and integrity checks still run."
    • addedInput schema / properties / repair
      Added value: +{
      +  "description": "Fix what the integrity check found: dangling connection ids, synapse files pointing at missing neurons, entry_dates/entry_status keys with no live entry, manifest counters. Off in dry_run; the report lists repairs[] one line each.",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / unarchive
      Added value: +{
      +  "anyOf": [
      +    {
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    {
      +      "const": "all",
      +      "type": "string"
      +    }
      +  ],
      +  "description": "Move these neuron ids (or \"all\") from archives/ back into the cortex and reindex them. Off in dry_run; the report says archives_count and unarchived_neurons; unknown ids are listed in notes."
      +}
  4. Changed3 schema fields changedv1.14.0
    • addedInput schema / properties / archive
      Added value: +{
      +  "description": "Also move cold neurons (heat < 0.05, untouched 90+ days) out of the cortex. Off by default; run dry_run first and read archivable_neurons. Restore by moving the file from archives/ back into cortex/.",
      +  "type": "boolean"
      +}
    • changedInput schema / properties / dry_run / description
      Previous value: -"If true, only report what would happen without acting"New value: +"true = report only: no heat recalc, archiving, purge, lock sweep, pruning or index rebuild. Counts, debts and integrity checks still run."
    • addedInput schema / properties / purge_boilerplate
      Added value: +{
      +  "description": "Also delete contentless facts left by early miner versions (\"Referenced in: file.md\"). Off by default; every run reports how many there are. Neurons left empty are kept.",
      +  "type": "boolean"
      +}
  5. First observedv1.4.0

TDQS

A4.6/5.0
Behavior5/5

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

Beyond the annotations (destructive, idempotent, not read-only), the description discloses that dry_run writes nothing at all, that the global map is computed live and never cached, and that archiving cold neurons makes them unsearchable. It also warns that on a mature brain most neurons look cold, adding risk context the annotations alone do not provide.

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 dense but front-loaded with the core behavior, then the dry-run guarantee, then the optional extras, and finally sibling alternatives. Every sentence earns its place for a tool with seven optional parameters, though the long run-on enumeration makes it slightly harder to parse than a bulleted structure would.

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?

For a complex maintenance tool with no output schema, the description adequately covers default behavior, report contents, dry-run semantics, optional destructive operations, and alternatives. An agent has enough context to choose and invoke the tool correctly, including knowing to run dry_run first and check samples.

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?

The input schema already covers 100% of parameters with detailed descriptions, so the baseline is 3. The main description does add a high-level warning that extras are off unless asked, but it does not materially enrich the per-parameter semantics beyond what the schema already provides.

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 names a specific action ('brain housekeeping') and enumerates concrete operations: recalculating heat, pruning weak synapses, checking integrity, and rebuilding the search index. It also distinguishes itself from siblings by pointing to crbro_consolidate for session close and crbro_inspect for read-only access.

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 explicitly states when to use this tool versus alternatives: use crbro_consolidate for session close and crbro_inspect for read-only operations. It also clarifies that destructive extras are OFF unless the caller explicitly enables them, which is critical guidance for a destructive tool.

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