Skip to main content
Glama
bsreeram08

Git Repo Browser MCP

git_local_changes

View uncommitted changes in a Git repository's working directory to track modifications before committing.

Instructions

Get uncommitted changes in the working directory.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
repo_pathYesThe path to the local Git repository

Implementation Reference

  • The core handler function that implements the git_local_changes tool. It uses simpleGit to retrieve the repository status, including staged, modified, new, deleted, and conflicted files, along with diffs for modified files.
     * Handles the git_local_changes tool request
     * @param {Object} params - Tool parameters
     * @param {string} params.repo_path - Local repository path
     * @returns {Object} - Tool response
     */
    export async function handleGitLocalChanges({ repo_path }) {
      try {
        // Use the provided local repo path
        const git = simpleGit(repo_path);
    
        // Get status information
        const status = await git.status();
    
        // Get detailed diff for modified files
        let diffs = {};
        for (const file of status.modified) {
          diffs[file] = await git.diff([file]);
        }
    
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(
                {
                  branch: status.current,
                  staged_files: status.staged,
                  modified_files: status.modified,
                  new_files: status.not_added,
                  deleted_files: status.deleted,
                  conflicted_files: status.conflicted,
                  diffs: diffs,
                },
                null,
                2
              ),
            },
          ],
        };
      } catch (error) {
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(
                { error: `Failed to get local changes: ${error.message}` },
                null,
                2
              ),
            },
          ],
          isError: true,
        };
      }
    }
  • The input schema definition for the git_local_changes tool, specifying the required repo_path parameter.
      name: "git_local_changes",
      description: "Get uncommitted changes in the working directory.",
      inputSchema: {
        type: "object",
        properties: {
          repo_path: {
            type: "string",
            description: "The path to the local Git repository",
          },
        },
        required: ["repo_path"],
      },
    },
  • src/server.js:905-905 (registration)
    Registration of the git_local_changes tool name to its handler function in the handlersMap.
    git_local_changes: handleGitLocalChanges,
  • src/server.js:852-854 (registration)
    Registers the tool list including git_local_changes schema for the ListToolsRequest.
    this.server.setRequestHandler(ListToolsRequestSchema, async () => ({
      tools: this.toolsList,
    }));
  • src/server.js:16-16 (registration)
    Import of the handleGitLocalChanges handler from handlers/index.js.
    handleGitLocalChanges,
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states what the tool does but omits critical details: whether it shows staged vs unstaged changes, output format, error handling for invalid paths, or performance implications. For a read operation with zero annotation coverage, this is insufficient.

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, efficient sentence that front-loads the core purpose without unnecessary words. Every part of the sentence contributes directly to understanding the tool's function, making it highly concise and well-structured.

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 lack of annotations and output schema, the description is incomplete for effective tool use. It doesn't explain what 'uncommitted changes' includes (e.g., modified, deleted, new files) or the return format, leaving gaps that could hinder an agent's ability to invoke and interpret results correctly.

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 input schema has 100% description coverage, clearly documenting the 'repo_path' parameter. The description doesn't add any parameter-specific details beyond what's in the schema, but since the schema is comprehensive, a baseline score of 3 is appropriate as it doesn't need to compensate.

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 action ('Get') and resource ('uncommitted changes in the working directory'), making the tool's purpose immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'git_status' (if present) or explain how it differs from 'git_diff' operations, which prevents a perfect score.

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_status' or other change-tracking tools. It lacks context about prerequisites (e.g., needing a valid repo) or exclusions, leaving the agent to infer usage from the purpose alone.

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/bsreeram08/git-commands-mcp'

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