Skip to main content
Glama

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

NameRequiredDescriptionDefault
repo_pathYes

Input Schema (JSON Schema)

{ "properties": { "repo_path": { "title": "Repo Path", "type": "string" } }, "required": [ "repo_path" ], "title": "GitReset", "type": "object" }

Implementation Reference

  • 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"
  • Pydantic BaseModel defining the input schema for the git_reset tool, requiring a repo_path.
    class GitReset(BaseModel): repo_path: str
  • 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(), ),
  • Enum constant defining the tool name 'git_reset' used in registration and dispatching.
    RESET = "git_reset"
  • 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 )]

Other Tools

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

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