git_status
Show the working tree status of a Git repository by providing its path.
Instructions
Shows the working tree status
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| repo_path | Yes |
Implementation Reference
- The actual handler function for git_status tool. Calls repo.git.status() to get the working tree status.
def git_status(repo: git.Repo) -> str: return repo.git.status() - Pydantic input schema for git_status tool, requiring only 'repo_path' as a string.
class GitStatus(BaseModel): repo_path: str - src/git/src/mcp_server_git/server.py:308-318 (registration)Tool registration in list_tools(). Defines name='git_status' via GitTools.STATUS enum, description, inputSchema, and annotations.
return [ Tool( name=GitTools.STATUS, description="Shows the working tree status", inputSchema=GitStatus.model_json_schema(), annotations=ToolAnnotations( readOnlyHint=True, destructiveHint=False, idempotentHint=True, openWorldHint=False, ), - src/git/src/mcp_server_git/server.py:482-488 (registration)Tool dispatch in call_tool() - matches GitTools.STATUS and calls git_status(repo).
match name: case GitTools.STATUS: status = git_status(repo) return [TextContent( type="text", text=f"Repository status:\n{status}" )] - Enum definition mapping STATUS to the string 'git_status' used for tool routing.
class GitTools(str, Enum): STATUS = "git_status"