git_status
Check Git repository status to view tracked, untracked, and staged file changes in your working tree.
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 on the given repository using repo.git.status().def git_status(repo: git.Repo) -> str: return repo.git.status()
- Pydantic BaseModel defining the input schema for the git_status tool, requiring a repo_path string.class GitStatus(BaseModel): repo_path: str
- src/git/src/mcp_server_git/server.py:288-290 (registration)Registration of the git_status tool in the list_tools() method, specifying name, description, and input schema.name=GitTools.STATUS, description="Shows the working tree status", inputSchema=GitStatus.model_json_schema(),
- Dispatch handler in the main call_tool function that invokes git_status and formats the response as TextContent.case GitTools.STATUS: status = git_status(repo) return [TextContent( type="text", text=f"Repository status:\n{status}" )]
- Enum value in GitTools defining the tool name 'git_status'.STATUS = "git_status"