create_backup
Create an on-demand backup of a GnuCash book using SQLite's online backup API. Verifies the copy with PRAGMA integrity_check before declaring success.
Instructions
Create an on-demand backup of the GnuCash book.
Uses SQLite's online backup API so the snapshot is safe even
if the book is being read or written concurrently by GnuCash
desktop. Verifies the copy with PRAGMA integrity_check
before declaring success; a failed check deletes the bad
backup and raises.
Manual backups are kept indefinitely — automatic retention
(session / weekly / monthly stages) does not touch them. Use
prune_backups(stage="manual") if you want to clean them
up explicitly.
The response includes a restore_hint describing the
filesystem command to restore from this backup. Restore is a
human-run filesystem operation, not an MCP tool — see
docs/RESTORE_FROM_BACKUP.md for details.
Args:
label: Optional free-text label (sanitized to
[A-Za-z0-9_-]) appended to the filename for human
context, e.g. "pre-recategorization" or
"pre-tax-filing".
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| label | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |