Skip to main content
Glama

git_revert

Destructive

Undo an already committed bad change by adding a new commit with the opposite changes, preserving history. Fails on merge conflicts; use git_restore for uncommitted file edits.

Instructions

Undo one earlier commit by adding a new commit with the opposite changes; history is kept, and the files in the mirror change accordingly. Use it to roll back a bad change that is already committed. Fails on a merge conflict. To undo uncommitted edits to one file, use git_restore instead.

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": {
      "ref": "<ref>"
    },
    "name": "git_revert"
  }
}

Input Schema

NameRequiredDescriptionDefault
refYesCommit to undo: a hash from git_log, or e.g. "HEAD" for the latest.
placeNoTarget place (PlaceId or project name) whose mirror repo to use. Defaults to the bound/sole connected place.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.1.1
    • changedInput schema / properties / place / description
      Previous value: -"Target place (PlaceId or project name); defaults to the bound/sole place"New value: +"Target place (PlaceId or project name) whose mirror repo to use. Defaults to the bound/sole connected place."
    • changedInput schema / properties / ref / description
      Previous value: -"commit to revert"New value: +"Commit to undo: a hash from git_log, or e.g. \"HEAD\" for the latest."
  2. First observedv0.1.0

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already flag destructiveHint=true and readOnlyHint=false, so the safety profile is known; the description adds real value on top by explaining that history is preserved, that mirror files change, and that merge conflicts cause failure. It does not cover permission requirements or what the tool returns, but for a tool whose annotations carry the destructive warning, this is strong supplemental context.

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 short sentences, front-loaded with the mechanism (new commit with opposite changes) before the use case, the failure mode, and the alternative. Every clause carries information; nothing is redundant with the name or title.

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 a two-parameter mutation tool with full schema coverage and no output schema, the description supplies the mechanism, the failure mode, and the sibling alternative, which is close to complete. The only gap is the absence of any note on prerequisites such as a clean working tree or required permissions.

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

Parameters3/5

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

Schema coverage is 100%, with the ref parameter already documented as a hash from git_log or "HEAD" and the place parameter described with its default. The description adds only the notion that the commit should be an 'earlier' one, which is marginal beyond the schema; baseline 3 applies when the schema does the heavy lifting.

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 precise verb and resource ('Undo one earlier commit by adding a new commit with the opposite changes') and immediately clarifies that history is kept, which distinguishes this from a reset-style operation. It also names the sibling it is not (git_restore) for the uncommitted-edit case, so an agent can separate the two tools without inspecting schemas.

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?

Explicit when-to-use ('roll back a bad change that is already committed'), an explicit failure condition ('Fails on a merge conflict'), and an explicit alternative with its own scope ('To undo uncommitted edits to one file, use git_restore instead'). This covers use, non-use, and routing in three sentences.

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