restore_catalog
Restore an exported catalog archive into a named catalog, either as a new catalog or by overwriting matching items with confirmation; no merge, and missing secrets are reported.
Instructions
Restore a catalog archive produced by export_catalog as catalog catalog (the same or a new name). Call this ONLY when the user has explicitly asked to restore and named the archive to use. A restore never merges: it is refused (with the clashing names) when the catalog already exists or any archived tap or pipeline name exists anywhere on this install. mode=overwrite replaces only items already in catalog and needs confirm equal to the catalog name. It never writes secrets: missing ones come back under missingSecrets for the user to create. Restored taps are left disabled; tell the user to test and enable them. Items that could not be restored come back under failed; report them. Archived AI scripts are restored as-is unless regenerate_scripts is set; scriptsImported, scriptsRegenerated and scriptsKept (a live script left in place; both with the reason) say which were which. The response carries sourceEnvironment (where the archive was exported) and targetEnvironment (this install), plus a warning when they differ; tell the user. If this Datris instance's agent policy requires a person to approve this action, the call does NOT perform it: it returns status pending_approval with an approvalId. Tell the user it is waiting for approval in Datris, then poll get_approval with that id (pause with wait_seconds between polls) — do not re-issue the action.
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": {
"catalog": "<catalog>",
"archive_base64": "<archive_base64>"
},
"name": "restore_catalog"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | new (default): the catalog and every archived name must not exist yet. overwrite: replace items already in this catalog; needs confirm. | |
| reason | No | Optional one-line reason for this change, recorded in the platform's audit log and shown to anyone asked to approve it. | |
| catalog | Yes | Catalog name to restore into (letters, digits, '_' and '-'). | |
| confirm | No | Required for mode=overwrite: the catalog name, repeated. | |
| restore_state | No | Optional, default true. false skips each tap's incremental state (for a copy that should start from scratch). | |
| archive_base64 | Yes | The archive as base64 (the `archiveBase64` value export_catalog returned). | |
| regenerate_scripts | No | Optional, default false. true regenerates each pipeline's AI scripts on this install instead of restoring the archived ones. |