Skip to main content
Glama

scry_db_health

Check SQLite database health for corruption vs write-lock contention. Returns status (ok/corrupt/locked), integrity check result, doc count, and error info to guide auto-restore decisions.

Instructions

Probe the scry project database and report health.

Designed for substrate code (e.g. reflection's wake.py auto-restore loop) that needs to distinguish actual corruption from transient WAL write-lock contention. The same scry-mcp connection primitives are used as for every other tool — long busy_timeout, WAL journal mode, retry semantics — so a healthy-but-busy DB will not be reported as corrupt.

Returns JSON with these fields:

status "ok" | "corrupt" | "locked" integrity result of PRAGMA integrity_check (string), or null when the probe could not run (e.g. status=locked) doc_count integer row count of scry__doc, or null when the table does not exist yet (fresh / unmigrated DB) doc_count_error populated when doc_count is null and the count query failed for a known-benign reason (table missing); null otherwise db_path absolute path to the project.db file probed error string explanation when status != "ok"; null otherwise

Status semantics for substrate decisions:

status="ok" DB is healthy. Do not quarantine. status="locked" DB is healthy but contended. Do NOT quarantine; retry the probe on the next wake. Substrate code that conflates this with corruption causes the Group-C cascade described in the May 2026 diagnostic. status="corrupt" DB failed PRAGMA integrity_check or could not be opened as a SQLite database at all. Safe to initiate auto-restore.

A status="ok" with doc_count=null and doc_count_error="no such table: scry__doc" is a fresh-and-unmigrated DB. Substrate should run migrations (or call scry_surface) rather than quarantine.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

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

With no annotations, the description fully bears the burden of disclosing behavior. It details the tool's retry semantics, WAL journal mode, busy_timeout, and how it handles different database states. It also explains the output fields and their meanings.

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 longer than average but well-structured with sections for output fields and status semantics. It front-loads the purpose in the first sentence. While concise, the length is justified by the need for detailed behavioral guidance.

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?

Given no parameters and an output schema exists, the description covers all necessary context: purpose, usage, behavioral details, output semantics, and decision rules for substrate code. It is fully complete for a health-check tool.

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 has zero parameters, so the description cannot add parameter semantics beyond the schema. Baseline for 0 params is 4, and the description provides extensive context about the tool's operation and output, which compensates for the lack of parameters.

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 explicitly states 'Probe the scry project database and report health', with a clear verb and resource. It is distinct from siblings like scry_grep or scry_mint, which serve different purposes.

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 provides explicit guidance on when to use this tool, including distinguishing corruption from transient WAL lock contention, and interpreting status values ('ok', 'locked', 'corrupt') for substrate decisions. It also explains what to do when doc_count is null (fresh DB).

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/prmichaelsen/scry'

If you have feedback or need assistance with the MCP directory API, please join our Discord server