git_status
View the working tree status of a Git repository, including tracked and untracked files, staged changes, and branch information, to manage repository updates effectively.
Instructions
Shows the working tree status
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": "GitStatus",
"type": "object"
}
Implementation Reference
- src/mcp_server_git/server.py:278-283 (handler)Handler execution for git_status tool within the call_tool method, calling git_status and formatting the response.case GitTools.STATUS: status = git_status(repo) return [TextContent( type="text", text=f"Repository status:\n{status}" )]
- src/mcp_server_git/server.py:77-78 (handler)Core handler function implementing git_status logic using gitpython Repo.git.status().def git_status(repo: git.Repo) -> str: return repo.git.status()
- src/mcp_server_git/server.py:19-21 (schema)Pydantic schema/model for git_status tool input, requiring repo_path.class GitStatus(BaseModel): repo_path: str
- src/mcp_server_git/server.py:171-175 (registration)Registration of git_status tool in list_tools(), providing name, description, and schema.Tool( name=GitTools.STATUS, description="Shows the working tree status", inputSchema=GitStatus.schema(), ),
- src/mcp_server_git/server.py:64-64 (helper)Enum constant defining the tool name 'git_status' in GitTools.STATUS = "git_status"