Skip to main content
Glama
martinsky999

MCP Git Server

by martinsky999

git_reset

Unstage all staged changes in a Git repository to revert them to the working directory, allowing you to modify or discard changes before committing.

Instructions

Unstages all staged changes

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
repo_pathYes

Implementation Reference

  • The core handler function that executes the git_reset tool logic: resets the Git index to unstage all changes.
    def git_reset(repo: git.Repo) -> str:
        repo.index.reset()
        return "All staged changes reset"
  • Pydantic BaseModel defining the input schema for the git_reset tool, requiring repo_path.
    class GitReset(BaseModel):
        repo_path: str
  • Registration of the 'git_reset' tool (name from GitTools.RESET) in the list_tools() method with description and input schema.
    Tool(
        name=GitTools.RESET,
        description="Unstages all staged changes",
        inputSchema=GitReset.schema(),
    ),
  • Enum definition in GitTools where RESET is set to the tool name 'git_reset'.
    RESET = "git_reset"
  • Invocation of git_reset handler within the main call_tool dispatcher.
    case GitTools.RESET:
        result = git_reset(repo)
        return [TextContent(
            type="text",
            text=result
        )]

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/martinsky999/mcp-git-py'

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