Shrink Database
shrinkDatabaseReclaim disk space by vacuuming the SQLite database after clearing history or lowering retention; it briefly blocks check recording while rewriting the file.
Instructions
Gives the space of deleted history back to the disk by rewriting the SQLite file (VACUUM). Run it after clearing history or lowering keepDataPeriodDays; it frees nothing otherwise. While it runs, Uptime Kuma cannot record checks, and it needs free disk space about the database's size. A large database takes minutes. SQLite only: refused on MariaDB, where Uptime Kuma has nothing to do. Returns the size before and after.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "shrinkDatabase"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | ||
| freed | Yes | The difference, in KB / MB / GB | |
| sizeAfter | Yes | Bytes after shrinking | |
| sizeBefore | Yes | Bytes before shrinking |