Skip to main content
Glama
modelcontextprotocol

git MCP server

Official

git_reset

Unstage all staged changes in a Git repository to reset the staging area and prepare for new commits.

Instructions

Unstages all staged changes

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
repo_pathYes

Implementation Reference

  • The handler function that executes git reset by calling repo.index.reset() to unstage all changes.
    def git_reset(repo: git.Repo) -> str:
        repo.index.reset()
        return "All staged changes reset"
  • Pydantic model defining the input schema for the git_reset tool, requiring repo_path.
    class GitReset(BaseModel):
        repo_path: str
  • Registration of the git_reset tool in the list_tools() function, specifying name, description, and input schema.
    Tool(
        name=GitTools.RESET,
        description="Unstages all staged changes",
        inputSchema=GitReset.model_json_schema(),
    ),
  • Enum defining the tool name constant GitTools.RESET = "git_reset" used in registration and matching.
    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"
        LOG = "git_log"
        CREATE_BRANCH = "git_create_branch"
        CHECKOUT = "git_checkout"
        SHOW = "git_show"
    
        BRANCH = "git_branch"

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