git_status
Check the status of a Git repository's working tree by providing the repository path. Track changes, untracked files, and branch information in a clear summary.
Instructions
Shows the working tree status
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| repo_path | Yes |
Implementation Reference
- Core handler function that executes the git status command using GitPython's Repo.git.status(), with optional porcelain format.def git_status(repo: Repo, porcelain: bool = False) -> str: """Get repository status in either human-readable or machine-readable format. Args: repo: Git repository object porcelain: If True, return porcelain (machine-readable) format Returns: Status output string """ if porcelain: return repo.git.status("--porcelain") else: return repo.git.status()
- src/mcp_server_git/git/models.py:6-9 (schema)Pydantic input schema/model for the git_status tool, defining repo_path (required) and optional porcelain flag.class GitStatus(BaseModel): repo_path: str porcelain: bool = False
- src/mcp_server_git/core/tools.py:174-181 (registration)ToolDefinition registration in the central ToolRegistry, associating name 'git_status', schema GitStatus, category GIT, and placeholder handler (later overridden). Also defines GitTools.STATUS = "git_status" enum at line 19.ToolDefinition( name=GitTools.STATUS, category=ToolCategory.GIT, description="Show the working tree status", schema=GitStatus, handler=placeholder_handler, requires_repo=True, ),
- src/mcp_server_git/core/handlers.py:66-67 (registration)Handler wiring in CallToolHandler._get_git_handlers(): maps "git_status" to a wrapped git_status function from git.operations, imported at lines 40-61, and registers via router.set_handlers."git_status": self._create_git_handler(git_status, requires_repo=True), "git_diff_unstaged": self._create_git_handler(