git_reset
Unstage all staged changes in a Git repository to revert them to an unmodified state. Specify the repository path to execute the command.
Instructions
Unstages all staged changes
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| repo_path | Yes |
Input Schema (JSON Schema)
{
"properties": {
"repo_path": {
"title": "Repo Path",
"type": "string"
}
},
"required": [
"repo_path"
],
"title": "GitReset",
"type": "object"
}
Implementation Reference
- src/mcp_server_git/server.py:97-99 (handler)The handler function that executes the git_reset tool logic by resetting the Git repository index (unstaging changes) and returning a confirmation message.def git_reset(repo: git.Repo) -> str: repo.index.reset() return "All staged changes reset"
- src/mcp_server_git/server.py:40-41 (schema)Pydantic BaseModel defining the input schema for the git_reset tool, requiring a repo_path.class GitReset(BaseModel): repo_path: str
- src/mcp_server_git/server.py:201-205 (registration)Registration of the 'git_reset' tool within the list_tools() handler, specifying name, description, and input schema.Tool( name=GitTools.RESET, description="Unstages all staged changes", inputSchema=GitReset.schema(), ),
- src/mcp_server_git/server.py:70-70 (helper)Enum constant defining the tool name 'git_reset' used in registration and dispatching.RESET = "git_reset"
- src/mcp_server_git/server.py:320-325 (registration)Dispatcher in call_tool() that invokes the git_reset handler when the tool is called.case GitTools.RESET: result = git_reset(repo) return [TextContent( type="text", text=result )]