Skip to main content
Glama

Git Reset

git_reset

Reset repository HEAD to undo commits, unstage files, or discard changes. Use soft, mixed, or hard modes to control whether modifications are preserved, unstaged, or removed.

Instructions

Reset current HEAD to specified state. Can be used to unstage files (soft), discard commits (mixed), or discard all changes (hard).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathNoPath to the Git repository. Defaults to session working directory set via git_set_working_dir..
modeNoReset mode: soft (keep changes staged), mixed (unstage changes), hard (discard all changes), merge (reset and merge), keep (reset but keep local changes).mixed
targetNoTarget commit to reset to (default: HEAD).
pathsNoSpecific file paths to reset (leaves HEAD unchanged).
confirmedNoExplicit confirmation required for hard, merge, and keep reset modes on protected branches (main, master, production, etc.).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
successYesIndicates if the operation was successful.
modeYesReset mode that was used.
targetYesTarget commit that was reset to.
filesResetYesFiles that were affected by the reset.
Behavior4/5

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

The description effectively discloses graduated destructiveness levels (discard commits vs discard all changes) that complement the readOnlyHint: false annotation. It appropriately warns about data loss potential for hard resets, adding safety context beyond what the boolean annotation alone provides.

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 two-sentence structure is optimally efficient—first establishing the core operation, second detailing modal variations. Zero redundancy; every clause conveys distinct functional information appropriate for agent tool selection.

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

Completeness3/5

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

While the output schema handles return values and the description covers the three most common modes, it incompletely represents the tool's full capability set by omitting merge and keep modes defined in the schema. It also incorrectly implies all operations modify HEAD, failing to mention that the paths parameter enables file-specific resets without moving HEAD.

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?

With 100% schema description coverage, the structured definitions already comprehensively document all parameters including enums and defaults. The description adds semantic framing by categorizing modes by function (unstaging vs discarding), meeting the baseline expectation for high-coverage schemas without adding significant additional constraints or syntax details.

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

Purpose4/5

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

The description provides a specific verb-resource pair ('Reset current HEAD to specified state') and clearly articulates three primary operational modes (soft, mixed, hard). However, it does not explicitly differentiate this tool from git_checkout (which also moves HEAD) or acknowledge the file-specific reset capability via the paths parameter.

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

Usage Guidelines3/5

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

The description maps reset modes to specific outcomes (unstage files, discard commits, discard changes), providing clear internal guidance for selecting modes. However, it lacks explicit guidance on when to use this tool versus alternatives like git_checkout or git_clean, leaving the agent to infer the appropriate tool selection.

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

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