Skip to main content
Glama

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

NameRequiredDescriptionDefault
envNoEnvironment name from .cfg.toml (e.g. dev, prod). Selects the target database.dev
refNoRestore this record to this ref (=HEAD, @<seq>, tag:<name>, or an oid prefix).
tagNoRestore the system to the version labelled with this tag.
as_ofNoRestore the system to its state at this ISO-8601 timestamp.
authorNoAuthor attribution hint. Ignored/rejected in authenticated/enforced identity modes where a verified identity is required.
recordNoOptional collection:id to restore one record; omit for a system-wide restore.
dry_runNoPreview (record or system): what would be restored, with field-level changes for a single record. Writes nothing.
messageNoWhy you are restoring (stored in history).restore
config_fileNoOmit: 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_validateNoSkip the collection validator for an emergency write (recorded in history). Off by default.
discard_driftNoSingle 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

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.6.5

TDQS

A4.4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden and does substantial work: it discloses that a system restore never deletes, that orphaned records are reported as not_in_tag/did_not_exist and left live, and that the write path is drift-guarded. It leaves idempotency, permission requirements, and partial-failure behavior unstated, but the presence of an output schema offsets the need to describe return values.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three sentences, each doing distinct work: capability, non-obvious side-effect semantics, then the sibling escape hatch and the preview instruction. Front-loaded and free of redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For an 11-parameter, zero-required tool this is close to complete: mode selection is explained, the destructive-looking case is clarified, and the output schema covers results. The remaining gap is mutual exclusivity/precedence among record, ref, tag, and as_of, which an agent must still infer.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3; the description earns above that by explaining how parameters combine into two distinct modes (record+ref versus tag or as_of), which is the single most important thing an agent must get right. It does not clarify precedence if conflicting mode parameters are passed together.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb (restore) and resource scope with both operating modes spelled out: single record via record+ref, whole system via tag or as_of. It also names the mechanism (drift-guarded write path) and routes a related case to cfg_rm, so an agent can distinguish it from siblings without opening the schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives clear operational guidance: preview with dry_run first, and use cfg_rm to clean up records created after the restore point. What is missing is exclusion guidance for the ambiguous inputs — nothing says whether tag and as_of are mutually exclusive or what a system restore means when neither is supplied.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.