git_diff_unstaged
Identify unstaged changes in your working directory to track modifications before committing. Specify the repository path to review differences efficiently.
Instructions
Shows changes in the working directory that are not yet staged
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": "GitDiffUnstaged",
"type": "object"
}
Implementation Reference
- src/mcp_server_git/server.py:80-81 (handler)The core handler function for the git_diff_unstaged tool, which returns the unstaged changes using repo.git.diff().def git_diff_unstaged(repo: git.Repo) -> str: return repo.git.diff()
- src/mcp_server_git/server.py:22-23 (schema)Pydantic input schema model for git_diff_unstaged tool, requiring repo_path.class GitDiffUnstaged(BaseModel): repo_path: str
- src/mcp_server_git/server.py:177-180 (registration)Tool registration in list_tools() for git_diff_unstaged, defining name, description, and input schema.name=GitTools.DIFF_UNSTAGED, description="Shows changes in the working directory that are not yet staged", inputSchema=GitDiffUnstaged.schema(), ),
- src/mcp_server_git/server.py:65-65 (registration)Enum constant defining the tool name 'git_diff_unstaged' in GitTools.DIFF_UNSTAGED = "git_diff_unstaged"
- src/mcp_server_git/server.py:285-290 (helper)Dispatcher in call_tool() that invokes the git_diff_unstaged handler and formats the response.case GitTools.DIFF_UNSTAGED: diff = git_diff_unstaged(repo) return [TextContent( type="text", text=f"Unstaged changes:\n{diff}" )]