Skip to main content
Glama
jesspig

git-mcp-server

by jesspig

git_reset

Destructive

Reset a Git repository to a target commit (default HEAD) in soft, mixed, or hard mode to undo commits, unstage changes, or discard working tree changes. Preview impact before confirming.

Instructions

Reset the repository to a target commit (default HEAD) in soft, mixed, or hard mode. Use this to undo commits, unstage changes, or discard working tree changes. DESTRUCTIVE: requires confirmed=True to execute; run preview=True first to see which tracked changes would be discarded (hard/mixed modes), while soft mode only moves HEAD and touches neither the working tree nor the index. Does NOT create a new commit — use git_revert to undo a published commit safely, or git_stash to keep changes before resetting. Best for: undoing commits or unstaging changes. Returns: 'Reset () to .' on success, or an impact preview when preview=True.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modeNoOne of: soft, mixed, hardmixed
targetNoCommit to reset to, defaults to HEAD
previewNoPreview the reset impact (files that would be discarded) without executing
confirmedNoExplicit confirmation for the destructive reset
repo_pathNoPath to the git repository, defaults to '.' (the server working directory).
Behavior5/5

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

The description goes well beyond the destructiveHint annotation by explaining the safety mechanisms: requires confirmed=True to execute, run preview=True first to see discarded changes, and details how soft mode only moves HEAD without touching working tree or index. It also discloses return values and preview behavior. No contradictions with annotations.

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?

The description is well-structured with a clear opening, usage line, safety warning, alternatives, and return behavior. Every sentence contributes value, though it is slightly longer than necessary and could be tightened. It is front-loaded and organized logically.

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?

The description fully covers a complex, destructive tool: it explains purpose, when to use, safety protocol, mode-specific effects, alternatives, and return format. Since there is no output schema, the description compensates by describing both success and preview returns. This is complete for an agent to use the tool effectively.

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 descriptions already cover all 5 parameters (100% coverage), so baseline is 3. The description adds extra meaning by explaining when confirmed and preview are needed, clarifying mode semantics (soft/mixed/hard effects), and noting the default repo_path. This goes beyond the schema, justifying a 4.

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 resets the repository to a target commit in soft, mixed, or hard mode, with examples of use cases (undo commits, unstage changes, discard working tree changes). It also distinguishes itself from git_revert and git_stash, making it unique among siblings.

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 guidance is provided: 'Use this to undo commits, unstage changes, or discard working tree changes.' It also explicitly mentions alternatives: 'use git_revert to undo a published commit safely, or git_stash to keep changes before resetting.' This covers when-to-use and when-not-to-use with clear alternatives.

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

Install Server

Other Tools

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/jesspig/git-mcp-server'

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