Skip to main content
Glama

Hard-reset config to a commit

git_rollback_to_commit
DestructiveIdempotent

Hard-reset the entire Home Assistant config directory to a known commit, discarding later commits and uncommitted changes. Requires confirm=True and is irreversible.

Instructions

Hard-reset the entire HA config directory to a previous commit.

Without confirm=True returns a safety prompt naming the current head commit; with confirm=True calls repo.git.reset('--hard', sha), which discards every commit and uncommitted change made after sha.

Use when: reverting /config entirely after a bad batch of changes, and the target commit is already known. Not for: restoring a single file — use git_rollback_file. Returns: dict {"status": "reset", "to": sha} on success. Errors: returns {"error": "confirmation_required", "message": ..., "action": ...} when confirm is not True; raises RuntimeError (from _repo()) when no git repo exists. Limits: requires confirm=True. WARNING: every commit and uncommitted change made after sha is permanently and irreversibly lost.

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": {
      "sha": "<sha>"
    },
    "name": "git_rollback_to_commit"
  }
}

Input Schema

NameRequiredDescriptionDefault
shaYesCommit SHA or ref to hard-reset the entire config directory to.
confirmNoMust be True to actually perform the reset. False (default) returns a safety prompt naming the current HEAD instead of touching anything.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.0.1

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already declare destructiveHint=true and readOnlyHint=false, but the description adds far more: the two-phase confirm gate, the exact operation performed (`repo.git.reset('--hard', sha)`), the precise blast radius (all commits and uncommitted changes after sha, irreversible), the confirmation_required error payload, and the RuntimeError raised when no repo exists.

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

Conciseness4/5

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

Well front-loaded with labeled sections (Use when / Not for / Returns / Errors / Limits) that make scanning easy. Minor redundancy: the loss of later commits is stated once in the body and again in the trailing WARNING, so one of the two could be cut.

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

Completeness5/5

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

For a two-parameter destructive git operation, nothing material is missing. Return and error shapes are given even though an output schema exists, and the confirmation gate plus irreversibility warning cover the risk surface an agent needs before calling it.

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 schema already documents both `sha` and `confirm` including the default false and the safety-prompt behavior. The description reinforces rather than extends this, though the success/error payload shapes add a little operational meaning about what each parameter value produces.

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?

Names a specific verb ('hard-reset') and resource ('the entire HA config directory') plus the target ('a previous commit'). It also explicitly carves out the sibling it is not ('Not for: restoring a single file — use git_rollback_file'), so an agent can route without opening either schema.

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

Usage Guidelines5/5

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

Has an explicit 'Use when' clause (reverting /config entirely after a bad batch, target commit already known) and an explicit 'Not for' clause pointing to git_rollback_file. Both the positive trigger and the exclusion are present.

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

Deploy Server

Other Tools