Skip to main content
Glama
bsreeram08

Git Repo Browser MCP

git_track

Stage specific files or all changes in a Git repository to prepare them for committing, enabling controlled version management of code modifications.

Instructions

Track (stage) specific files or all files.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
repo_pathYesThe path to the local Git repository
filesNoArray of file paths to track/stage (use ["."] for all files)

Implementation Reference

  • The main handler function for the git_track tool. It uses simpleGit to add (stage) the specified files to the index and returns the updated git status.
    export async function handleGitTrack({ repo_path, files = ["."] }) {
      try {
        const git = simpleGit(repo_path);
    
        // Add the specified files to the staging area
        await git.add(files);
    
        // Get status to show what files were tracked
        const status = await git.status();
    
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(
                {
                  success: true,
                  message: `Tracked ${
                    files.length === 1 && files[0] === "."
                      ? "all files"
                      : files.length + " files"
                  }`,
                  staged: status.staged,
                  not_staged: status.not_added,
                  modified: status.modified,
                },
                null,
                2
              ),
            },
          ],
        };
      } catch (error) {
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(
                { error: `Failed to track files: ${error.message}` },
                null,
                2
              ),
            },
          ],
          isError: true,
        };
      }
    }
  • The tool schema definition including name, description, and inputSchema for git_track, used in ListTools response.
    {
      name: "git_track",
      description: "Track (stage) specific files or all files.",
      inputSchema: {
        type: "object",
        properties: {
          repo_path: {
            type: "string",
            description: "The path to the local Git repository",
          },
          files: {
            type: "array",
            items: { type: "string" },
            description:
              'Array of file paths to track/stage (use ["."] for all files)',
            default: ["."],
          },
        },
        required: ["repo_path"],
      },
    },
  • src/server.js:908-908 (registration)
    Registration of the git_track handler in the this.handlersMap object, mapping the tool name to its handler function.
    git_track: handleGitTrack,
  • Re-export of handleGitTrack from commit-operations.js in handlers index for centralized imports.
    handleGitTrack,
  • Import of handleGitTrack from ./commit-operations.js in handlers index.
    handleGitTrack,
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 of behavioral disclosure. It states the action ('track/stage') but doesn't explain what happens after staging (e.g., files become ready for commit), potential side effects (e.g., overwriting previous staging), or error conditions (e.g., invalid file paths). For a mutation tool with zero annotation coverage, this leaves significant gaps in understanding its behavior.

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 extremely concise—a single sentence that directly states the tool's purpose without any fluff. It's front-loaded with the core action and resource, making it easy to parse quickly. Every word earns its place, and there's no wasted verbiage.

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 (a mutation operation with 2 parameters) and lack of annotations or output schema, the description is incomplete. It doesn't cover behavioral aspects like what staging entails, error handling, or output format. While the schema covers parameters, the overall context for safe and effective use is insufficient.

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?

Schema description coverage is 100%, so the schema fully documents both parameters (repo_path and files). The description adds no additional meaning beyond what's in the schema—it doesn't clarify parameter interactions, constraints, or examples beyond the default value hint. This meets the baseline of 3 when the schema handles parameter documentation effectively.

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 ('track/stage') and resource ('specific files or all files'), making the purpose immediately understandable. It distinguishes the tool's function from siblings like git_commit or git_reset by focusing on staging changes. However, it doesn't explicitly differentiate from git_add (if present) or other staging-related tools, keeping it at 4 rather than 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. It doesn't mention prerequisites (e.g., needing uncommitted changes), exclusions (e.g., not for untracked files if that's the case), or related tools like git_add or git_commit. Without such context, the agent must 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