cfg_restore
Roll back one config record or the whole system to a prior ref, tag, or timestamp through drift-guarded writes. Preview changes with dry_run; newer records are reported and left live.
Instructions
Restore one record (record + ref) or the whole system (tag or as_of) to a prior version, through the drift-guarded write path. A system restore never deletes: records created after the target point are reported (not_in_tag / did_not_exist) and left live; use cfg_rm for them. Preview with dry_run first.
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": "cfg_restore"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| env | No | Environment name from .cfg.toml (e.g. dev, prod). Selects the target database. | dev |
| ref | No | Restore this record to this ref (=HEAD, @<seq>, tag:<name>, or an oid prefix). | |
| tag | No | Restore the system to the version labelled with this tag. | |
| as_of | No | Restore the system to its state at this ISO-8601 timestamp. | |
| author | No | Author attribution hint. Ignored/rejected in authenticated/enforced identity modes where a verified identity is required. | |
| record | No | Optional collection:id to restore one record; omit for a system-wide restore. | |
| dry_run | No | Preview (record or system): what would be restored, with field-level changes for a single record. Writes nothing. | |
| message | No | Why you are restoring (stored in history). | restore |
| config_file | No | Omit: the server uses the .cfg.toml it started with. A different path is refused unless the server runs with CFGIT_MCP_ALLOW_CONFIG_OVERRIDE=1. | |
| no_validate | No | Skip the collection validator for an emergency write (recorded in history). Off by default. | |
| discard_drift | No | Single record only: overwrite a live doc that was changed outside cfgit (otherwise it refuses with changed_outside_cfgit). The discarded doc is kept in the history entry's meta.discarded_drift. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||