git_status
Check the status of your Git working tree to see tracked, untracked, and staged changes before committing.
Instructions
Shows the working tree status
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"repo_path": "<repo_path>"
},
"name": "git_status"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| repo_path | Yes |
Implementation Reference
- src/mcp_server_git/server.py:77-78 (handler)Core implementation of the git_status tool, executing repo.git.status() using gitpython.
def git_status(repo: git.Repo) -> str: return repo.git.status() - src/mcp_server_git/server.py:19-21 (schema)Pydantic input schema for the git_status tool, defining the required repo_path.
class GitStatus(BaseModel): repo_path: str - src/mcp_server_git/server.py:171-175 (registration)Registration of the git_status tool in the list_tools() decorator method.
Tool( name=GitTools.STATUS, description="Shows the working tree status", inputSchema=GitStatus.schema(), ), - src/mcp_server_git/server.py:278-283 (handler)Dispatch handler in call_tool() that invokes git_status and formats the TextContent response.
case GitTools.STATUS: status = git_status(repo) return [TextContent( type="text", text=f"Repository status:\n{status}" )] - src/mcp_server_git/server.py:64-64 (helper)Enum constant defining the tool name 'git_status' in GitTools.
STATUS = "git_status"