Inspect database health
litescope_healthInspect SQLite, D1, or Turso databases for corruption, WAL bloat, freelist fragmentation, and reachability issues. Returns a JSON report with issue severity.
Instructions
Inspect a SQLite or D1 database for operational faults: corruption (PRAGMA integrity check), WAL bloat from a starved checkpoint, freelist fragmentation, and reachability. Returns a JSON report with a severity (ok / warning / critical) and a list of issues. Read-only.
For D1: set CLOUDFLARE_API_TOKEN + CLOUDFLARE_ACCOUNT_ID and use source=d1://DB_ID.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| deep | No | Use the exhaustive integrity_check instead of the faster quick_check | |
| source | Yes | Database source: a local file path (./app.db), a Cloudflare D1 DSN (d1://DB_ID when CLOUDFLARE_API_TOKEN+CLOUDFLARE_ACCOUNT_ID are set, or d1://TOKEN@ACCOUNT_ID/DB_ID), or a Turso DSN (turso://TOKEN@ORG/DB). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| issues | No | Detected problems (empty when healthy). | |
| severity | Yes | Overall verdict. |