Skip to main content
Glama
martinsky999

MCP Git Server

by martinsky999

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}"
        )]
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It states the tool 'shows changes', implying a read-only operation, but doesn't disclose behavioral traits such as output format, error handling, or whether it requires specific Git states. This is a significant gap for a tool with no annotation coverage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, clear sentence with zero waste, front-loaded and appropriately sized for the tool's purpose. Every word earns its place without redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (Git operation with no annotations, no output schema, and low schema coverage), the description is incomplete. It lacks details on output format, error conditions, and how it differs from siblings, making it inadequate for full contextual understanding.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description adds no information about the single parameter 'repo_path' beyond what the input schema provides (schema description coverage is 0%). Since there is only one parameter, the baseline is 4, but the description fails to compensate for the lack of schema details, such as explaining what 'repo_path' represents or its format, so it's scored lower.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'shows changes' and specifies the resource as 'working directory that are not yet staged', which is specific and understandable. However, it doesn't explicitly differentiate from sibling tools like 'git_diff' or 'git_diff_staged', which would require a 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'git_diff' or 'git_diff_staged', nor does it mention prerequisites or exclusions. It merely states what the tool does without context for selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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