Skip to main content
Glama

git_diff_unstaged

View uncommitted changes in your working directory before staging them for commit, helping you review modifications.

Instructions

Shows changes in the working directory that are not yet staged

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
repo_pathYes

Implementation Reference

  • Core handler function implementing the git_diff_unstaged tool logic by calling repo.git.diff() to get unstaged changes.
    def git_diff_unstaged(repo: git.Repo) -> str: return repo.git.diff()
  • Pydantic schema defining the input for git_diff_unstaged tool: requires repo_path.
    class GitDiffUnstaged(BaseModel): repo_path: str
  • Tool registration in list_tools(): defines name 'git_diff_unstaged' (via GitTools.DIFF_UNSTAGED), description, and input schema.
    name=GitTools.DIFF_UNSTAGED, description="Shows changes in the working directory that are not yet staged", inputSchema=GitDiffUnstaged.schema(), ), Tool(
  • Enum defining tool names, including DIFF_UNSTAGED = "git_diff_unstaged" used in registration.
    class GitTools(str, Enum): STATUS = "git_status" DIFF_UNSTAGED = "git_diff_unstaged" DIFF_STAGED = "git_diff_staged" DIFF = "git_diff" COMMIT = "git_commit" ADD = "git_add" RESET = "git_reset" LOG = "git_log" CREATE_BRANCH = "git_create_branch" CHECKOUT = "git_checkout" SHOW = "git_show" INIT = "git_init"
  • Dispatcher in @server.call_tool(): handles the git_diff_unstaged tool call, invokes the handler, and formats response.
    case GitTools.DIFF_UNSTAGED: diff = git_diff_unstaged(repo) return [TextContent( type="text", text=f"Unstaged changes:\n{diff}" )]

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/martinsky999/mcp-git-py'

If you have feedback or need assistance with the MCP directory API, please join our Discord server