Skip to main content
Glama

run_diagnostics

Destructive

Validate and repair state-memory graphs, broken references, and SHA-256 audit chains; run storage maintenance including compaction, pruning, and deduplication.

Instructions

Run graph sanity checks, health diagnostics, reference validation, audit chain verification, and storage maintenance (actions: validate, doctor, check_refs, audit_chain, compact, archive, prune_events, version, dedupe). Use run_diagnostics instead of get_analytics when performing database repair, AST reference auto-healing, or verifying SHA-256 event hash chains.

Returns validation diagnostics, health report, broken reference repair log, Merkle chain audit, or maintenance stats.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
applyNoFor dedupe action: whether to apply merging (default: false for dry-run).
actionYesThe diagnostic or maintenance action to execute: validate, doctor, check_refs, audit_chain, compact, archive, prune_events, version, dedupe.
checksNoOptional subset of validation checks.
dry_runNoSimulate event pruning without deleting.
projectNoTarget project name or slug.
auto_healNoAutomatically fix broken file references on check_refs.
older_thanNoAge duration threshold for prune_events (e.g. 90d).
preserve_typesNoEvent types to preserve from pruning.
older_than_daysNoAge threshold in days for archive (default: 30).
prune_orphaned_edgesNoWhether to prune dangling edges during compact.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv1.3.1
    • changedInput schema / properties / action / description
      Previous value: -"The diagnostic or maintenance action to execute."New value: +"The diagnostic or maintenance action to execute: validate, doctor, check_refs, audit_chain, compact, archive, prune_events, version, dedupe."
    • addedInput schema / properties / action / enum
      Added value: +[
      +  "validate",
      +  "doctor",
      +  "check_refs",
      +  "audit_chain",
      +  "compact",
      +  "archive",
      +  "prune_events",
      +  "version",
      +  "dedupe"
      +]
  2. Changed3 schema fields changedv1.2.1
    • removedInput schema / $schema
      Removed value: -"http://json-schema.org/draft-07/schema#"
    • removedInput schema / additionalProperties
      Removed value: -true
    • addedInput schema / required
      Added value: +[
      +  "action"
      +]
  3. Addedv1.0.0

TDQS

A3.9/5.0
Behavior3/5

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

Annotations already declare destructiveHint=true, readOnlyHint=false, and idempotentHint=false, so the mutation risk is flagged structurally. The description adds useful nuance by separating read-only diagnostics (validate/doctor/check_refs/audit_chain) from maintenance actions (compact/archive/prune_events/dedupe), but it never states that those actions irreversibly delete data, nor does it expose the dry-run default.

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 verb and action set, followed by the sibling comparison and return values. The parenthetical action list largely duplicates the enum, which is mildly redundant, but the structure and length are otherwise efficient.

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

Completeness4/5

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

For a 10-parameter, no-output-schema tool, the description covers what actions exist and what each returns (diagnostics, health report, repair log, Merkle chain audit, maintenance stats). It stops short of linking action-specific parameters (apply, auto_heal, dry_run) to their triggering actions, leaving that to the schema.

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?

Schema description coverage is 100%, so all ten parameters (apply, dry_run, older_than, preserve_types, etc.) are already documented in the schema. The description restates only the action enum and adds no syntax, defaults, or cross-parameter constraints beyond what the schema 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?

States a specific verb (run) plus the resources/actions involved (validate, doctor, check_refs, audit_chain, compact, archive, prune_events, version, dedupe) and explicitly names the sibling it is not (get_analytics). An agent can distinguish it from the other manage_* and query tools without opening a 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?

Explicitly routes the agent: 'Use run_diagnostics instead of get_analytics when performing database repair, AST reference auto-healing, or verifying SHA-256 event hash chains.' This is clear when-to-use guidance, but it does not state when NOT to run destructive actions or any prerequisites (backups, permissions).

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