Skip to main content
Glama
modelcontextprotocol

git MCP server

Official

git_reset

DestructiveIdempotent

Unstage all changes that have been staged for commit, reverting the staging area to the last commit state.

Instructions

Unstages all staged changes

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
repo_pathYes

Implementation Reference

  • The handler function for git_reset tool. Calls repo.index.reset() to unstage all staged changes and returns a confirmation string.
    def git_reset(repo: git.Repo) -> str:
        repo.index.reset()
        return "All staged changes reset"
  • Pydantic model defining the input schema for git_reset tool. Only requires a repo_path string parameter.
    class GitReset(BaseModel):
        repo_path: str
  • Enum member RESET with value 'git_reset', used as the tool name identifier for registration and dispatch.
    class GitTools(str, Enum):
        STATUS = "git_status"
        DIFF_UNSTAGED = "git_diff_unstaged"
        DIFF_STAGED = "git_diff_staged"
        DIFF = "git_diff"
        COMMIT = "git_commit"
        ADD = "git_add"
        RESET = "git_reset"
  • Tool registration in the list_tools() function, declaring the git_reset tool with its description, schema, and annotations (destructive, idempotent).
    Tool(
        name=GitTools.RESET,
        description="Unstages all staged changes",
        inputSchema=GitReset.model_json_schema(),
        annotations=ToolAnnotations(
            readOnlyHint=False,
            destructiveHint=True,
            idempotentHint=True,
            openWorldHint=False,
        ),
  • Dispatch call in the call_tool() handler. When name matches GitTools.RESET ('git_reset'), it calls the git_reset function with the repo and returns the result as text content.
    case GitTools.RESET:
        result = git_reset(repo)
        return [TextContent(
            type="text",
            text=result
        )]
Behavior3/5

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

Annotations indicate destructiveHint=true and readOnlyHint=false, which already signal mutation and potential data loss. The description confirms it unstages all changes but adds no further behavioral context, such as working directory being unaffected.

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 a single, straightforward sentence with no extraneous information, which is appropriate for a simple tool. However, it might be too brief to be fully useful.

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?

Given the tool's simplicity and single parameter, the description is moderately complete. It covers the core action but misses parameter details and fails to mention that only staged changes are affected, not working tree modifications.

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

Parameters2/5

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

With 0% schema description coverage, the description does not explain the required 'repo_path' parameter. The agent receives no guidance on how to specify the repository path or any expected format.

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 specific verb 'unstages' and the resource 'all staged changes', which distinguishes it from sibling tools like git_add (stages) or git_diff_staged (shows staged diffs).

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives, nor any context about prerequisites or post-conditions. It simply states the basic action.

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/modelcontextprotocol/git'

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