Skip to main content
Glama

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

NameRequiredDescriptionDefault
repo_pathYes

Input Schema (JSON Schema)

{ "properties": { "repo_path": { "title": "Repo Path", "type": "string" } }, "required": [ "repo_path" ], "title": "GitDiffUnstaged", "type": "object" }

Implementation Reference

  • 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()
  • Pydantic input schema model for git_diff_unstaged tool, requiring repo_path.
    class GitDiffUnstaged(BaseModel): repo_path: str
  • 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(), ),
  • Enum constant defining the tool name 'git_diff_unstaged' in GitTools.
    DIFF_UNSTAGED = "git_diff_unstaged"
  • 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}" )]

Other Tools

Related Tools

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