Skip to main content
Glama
Cloto-dev

CPersona

Official
by Cloto-dev

check_health

Check memory database health (38-check registry, each issue tagged critical/warn/info): contamination, duplicates, oversized content, embeddings, FTS and schema integrity, SQLite file integrity, naming, JSON and timestamp drift, stale…

Instructions

Check memory database health (38-check registry, each issue tagged critical/warn/info): contamination, duplicates, oversized content, embeddings, FTS and schema integrity, SQLite file integrity, naming, JSON and timestamp drift, stale tasks, profiles and sources. Returns storage stats with project_id/channel distributions. The verdict is status (healthy / degraded / unhealthy, from severity counts; info never degrades). Read it as a verdict on what is IN the database, not on whether the pipeline that fills it is working: a corpus whose every embedding is NULL scores healthy while semantic recall is dead. Only fix=true judges the backend's liveness: a report-only run still contacts it (a probe embed, its identity, token counts) but reads none of that as liveness, so a quiet report-only run is not evidence the backend answered; the null_embedding finding says why its repair cannot run. checks runs a subset: an unknown name is rejected (ok=false), and every response echoes checks_run. fix=true repairs, agent-scoped and locked-safe, except block_index, coarse_index, dedup_msg_id_index, file_permissions, whose repairs reach every agent, so under an ACL they need read-write on '*'; leave them out of checks to stay agent-scoped. critical file-integrity findings are report-only. Lossy, irreversible repairs: oversized memories are cut to CPERSONA_MAX_CONTENT_LENGTH (default 16000) and the profile to CPERSONA_MAX_PROFILE_LENGTH (default 2000), keeping the start (lowering a cap shortens rows that fit the old one); duplicate_content and empty_content delete rows; memory_annotation and discord_mention strip text; invalid_json blanks unparseable JSON to '{}'; stale_pending_tasks deletes queued writes over an hour old; dedup_msg_id_index blanks colliding msg_ids; timestamp checks copy created_at over bad stamps. Some repairs are bounded per run (source canonicalisation classifies at most 10000 rows): a fix response with remaining > 0 has NOT converged; run fix again until remaining stops decreasing.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fixNoAuto-fix detected issues
checksNoRegistry check names to run (empty = all). See cpersona.checks.HEALTH_CHECK_NAMES.
agent_idNoAgent ID to check (empty = all agents)
session_keyNoOpaque session identity you declare: a partition hint, not authentication and not a data filter. Selects which no-persist pause applies to this call. Omit to share one bucket with every caller that omits it. Full text on recall.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv2.6.1
    • addedInput schema / properties / session_key / maxLength
      Added value: +256
  2. Changed1 schema field changedv2.5.10
    • addedInput schema / properties / session_key
      Added value: +{
      +  "default": "",
      +  "description": "Opaque session identity you declare: a partition hint, not authentication and not a data filter. Selects which no-persist pause applies to this call. Omit to share one bucket with every caller that omits it. Full text on recall.",
      +  "type": "string"
      +}
  3. Addedv2.5.2
  4. Removedv2.5.1
  5. Changed1 schema field changedv2.4.37
    • addedInput schema / properties / checks
      Added value: +{
      +  "description": "Registry check names to run (empty = all). See cpersona.checks.HEALTH_CHECK_NAMES.",
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
  6. First observedv0.1.0

TDQS

A4.2/5.0
Behavior5/5

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

Far beyond the single readOnlyHint=false annotation, it discloses exactly which repairs are lossy and irreversible (row deletion, content truncation with env caps, JSON blanking), which repairs escape agent scope and need read-write on '*', which findings are report-only, and per-run bounds with a non-convergence signal. It also warns that a report-only run still contacts the backend but is not liveness evidence.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The verdict semantics and the liveness caveat are front-loaded, which is good, but the middle is a dense run-on catalog of repairs with heavy parenthetical nesting. Much of it earns its place, yet it reads as one long block rather than structured sections.

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 mutating tool with no output schema, the description covers the salient response fields (`status` semantics and the info-never-degrades rule, `checks_run`, `remaining`) plus repair safety and convergence, which is what an agent needs to call it correctly and to interpret the result.

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 already 100%, yet the description adds semantics the schema lacks: unknown check names are rejected with ok=false, `checks_run` is echoed back, and fix=true behaves differently per check with ACL implications. `agent_id` and `session_key` get no additional treatment, which keeps it off a 5.

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 opening sentence states a specific verb and resource ('Check memory database health') and enumerates the check registry domains, so an agent knows exactly what it gets. It does not, however, differentiate itself from the sibling `deep_check`, which an agent could easily confuse with it.

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?

It gives real decision rules: report-only vs fix=true, using `checks` to stay agent-scoped, and looping while `remaining` decreases. The notable gap is that it never names `deep_check` or states which of the two an agent should prefer.

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