Skip to main content
Glama

Brain maintenance

crbro_maintenance
DestructiveIdempotent

Run brain housekeeping to recalculate heat, prune weak synapses, check integrity, rebuild the search index, and flag debts; use dry_run to report only without writing.

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. Extras run only when asked: archive cold neurons (they stop being searchable), unarchive, purge_boilerplate, repair, backfill_dates, compact. Session close is crbro_consolidate; reading the brain is crbro_inspect.

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": "crbro_maintenance"
  }
}

Input Schema

NameRequiredDescriptionDefault
repairNoFix what the integrity check found (dangling links, orphan synapses, stale keys, counters); lists repairs[].
archiveNoMove cold neurons (heat < 0.05, untouched 90+ days) to archives/, out of search. Dry-run first (archivable_ids); undo with unarchive.
compactNoFold one-line neurons from a bulk import (compact_groups) into one digest per group; sources copied to quarantine first, shared neurons untouched. Dry-run first.
dry_runNoReport only: nothing is written. Counts, debts and integrity checks still run.
unarchiveNoNeuron ids (or "all") to bring back from archives/ and reindex.
stale_listNoRead-only: page through every stale entry, most overdue first (default limit 50). Runs alone.
stale_reviewNoAct on many stale entries: verify (still true; its clock restarts) or retire them (superseded / retracted). Takes the pairs stale_list returns; runs alone, not with dry_run.
backfill_datesNoDate pre-1.13 entries from a day stated in their own text; nothing is guessed (dates_backfilled).
purge_boilerplateNoDelete contentless facts the miner left (counted in every report); a quarantine copy is kept.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed9 schema fields changedv2.12.0
    • changedInput schema / properties / archive / description
      Previous 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."New value: +"Move cold neurons (heat < 0.05, untouched 90+ days) to archives/, out of search. Dry-run first (archivable_ids); undo with unarchive."
    • changedInput schema / properties / backfill_dates / description
      Previous value: -"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."New value: +"Date pre-1.13 entries from a day stated in their own text; nothing is guessed (dates_backfilled)."
    • changedInput schema / properties / compact / description
      Previous value: -"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."New value: +"Fold one-line neurons from a bulk import (compact_groups) into one digest per group; sources copied to quarantine first, shared neurons untouched. Dry-run first."
    • changedInput schema / properties / dry_run / description
      Previous 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."New value: +"Report only: nothing is written. Counts, debts and integrity checks still run."
    • changedInput schema / properties / purge_boilerplate / description
      Previous value: -"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."New value: +"Delete contentless facts the miner left (counted in every report); a quarantine copy is kept."
    • changedInput schema / properties / repair / description
      Previous value: -"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."New value: +"Fix what the integrity check found (dangling links, orphan synapses, stale keys, counters); lists repairs[]."
    • addedInput schema / properties / stale_list
      Added value: +{
      +  "description": "Read-only: page through every stale entry, most overdue first (default limit 50). Runs alone.",
      +  "properties": {
      +    "limit": {
      +      "maximum": 200,
      +      "minimum": 1,
      +      "type": "integer"
      +    },
      +    "neuron_id": {
      +      "type": "string"
      +    },
      +    "offset": {
      +      "maximum": 9007199254740991,
      +      "minimum": 0,
      +      "type": "integer"
      +    }
      +  },
      +  "type": "object"
      +}
    • addedInput schema / properties / stale_review
      Added value: +{
      +  "description": "Act on many stale entries: verify (still true; its clock restarts) or retire them (superseded / retracted). Takes the pairs stale_list returns; runs alone, not with dry_run.",
      +  "properties": {
      +    "action": {
      +      "enum": [
      +        "verify",
      +        "superseded",
      +        "retracted"
      +      ],
      +      "type": "string"
      +    },
      +    "entries": {
      +      "items": {
      +        "properties": {
      +          "entry_id": {
      +            "type": "string"
      +          },
      +          "neuron_id": {
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "neuron_id",
      +          "entry_id"
      +        ],
      +        "type": "object"
      +      },
      +      "maxItems": 500,
      +      "minItems": 1,
      +      "type": "array"
      +    },
      +    "note": {
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "action",
      +    "entries"
      +  ],
      +  "type": "object"
      +}
    • changedInput schema / properties / unarchive / description
      Previous value: -"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."New value: +"Neuron ids (or \"all\") to bring back from archives/ and reindex."
  2. 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"
      +}
  3. Changed1 schema field changedv2.4.0
    • removedInput schema / $schema
      Removed value: -"http://json-schema.org/draft-07/schema#"
  4. 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."
      +}
  5. 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"
      +}
  6. 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 destructiveHint=true annotation, the description discloses what actually gets destroyed and how far it reaches: archived neurons stop being searchable, purge_boilerplate deletes mined facts, sources are copied to quarantine before compact. It also names the undo path (unarchive) and states that dry_run writes nothing, which is exactly the safety context an agent needs for a destructive write tool.

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?

Front-loaded with the write/destructive signal, then scope, then return contract, then sibling routing — a sensible ordering with almost no filler. It is dense to the point of being terse in places (the extras are name-dropped in a comma list), but every sentence carries information.

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 9-parameter, nested, destructive tool with no output schema, the description covers the essentials: what runs, what is opt-in, what is destroyed, what is reversible, and the shape of the returned report. Nothing an agent needs before invoking it safely appears to be missing.

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?

Schema coverage is 100%, so per-parameter meaning is already carried by the schema and a 3 would be the baseline. The description adds genuine framing on top: the extras are opt-in ('run only when asked'), dry_run is a global write suppressor, and the returned report shape (counts, integrity_issues, repairable, notes) plus debt flagging is explained.

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?

Opens with an explicit modality marker ('Write:') and names the concrete resource and operations (recalculate heat, prune synapses, check integrity, rebuild index). It explicitly routes away from two siblings — crbro_consolidate for session close and crbro_inspect for reading — so an agent can distinguish it without opening any schema.

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

Usage Guidelines4/5

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

Clear context is given: this is housekeeping/maintenance, extras 'run only when asked', and dry_run writes nothing. It also names when to use the siblings instead (session close, reading). What is missing is an explicit trigger condition for the default no-flag invocation (e.g. scheduled maintenance vs. before a session), leaving that to inference.

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