Inspect database health
litescope_healthInspects SQLite or D1 databases for corruption, WAL bloat, freelist fragmentation, and reachability, then returns a JSON severity report with issues. Read-only.
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.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"source": "<source>"
},
"name": "litescope_health"
}
}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. |