Skip to main content
Glama

lgh_rollback

Destructive

Roll back a local repository by N commits using git reset --hard, discarding uncommitted changes and rolled-back commits. Inspect what would be lost with diff/dry-run, or back up first, before executing.

Instructions

Roll the repository back N commits by running git reset --hard HEAD~N. Destructive: uncommitted changes and the rolled-back commits are discarded from the local branch, so run lgh_up or lgh_save first if anything there is worth keeping. With push enabled it also force-pushes the reset state to the LGH server so the backup matches; without push only the local branch moves. Returns JSON with from_commit, to_commit, rolled_back (the discarded commit's subject), and push success. Use lgh_diff or lgh_up_dryrun to inspect what would be lost before rolling back.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathNoAbsolute path to the LOCAL working directory (defaults to current directory)
pushNoForce push to LGH after rollback (default: false)
stepsNoNumber of commits to roll back (default: 1)

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observedv0.1.0

TDQS

A4.9/5.0
Behavior5/5

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

Beyond the destructiveHint annotation, the description explicitly states that uncommitted changes and rolled-back commits are discarded, explains push behavior (force-push to LGH), and details the JSON return fields.

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?

The description is dense but not verbose; every sentence adds critical information (action, destructiveness, push behavior, return format, and alternatives). It is well-structured and appropriately sized.

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?

Covers the core action, destructive consequences, push behavior, return value, and recommended pre-rollback inspection tools. No essential context is missing for a destructive operation.

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?

The description adds context for push (force-push when enabled) and steps (N commits), and explains the overall effect on the repository. While the schema already covers parameter definitions, the description enriches understanding of their behavioral impact.

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 clearly states the tool's action: rolling back N commits via git reset --hard HEAD~N. It distinguishes from siblings by mentioning lgh_up and lgh_save for saving before rollback and lgh_diff/lgh_up_dryrun for inspection.

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?

Explicitly instructs to run lgh_up or lgh_save first if anything is worth keeping, and to use lgh_diff or lgh_up_dryrun to inspect what would be lost. This provides clear when-to-use guidance.

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

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/JoeGlenn1213/lgh'

If you have feedback or need assistance with the MCP directory API, please join our Discord server