Skip to main content
Glama
bsreeram08

Git Repo Browser MCP

git_pull

Pull changes from a remote Git repository to update your local branch with the latest commits from the specified remote and branch.

Instructions

Pull changes from a remote repository.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
repo_pathYesThe path to the local Git repository
remoteNoRemote nameorigin
branchNoBranch to pull (default: current branch)
rebaseNoWhether to rebase instead of merge

Implementation Reference

  • Main handler function implementing the git_pull tool. Uses simpleGit to pull from remote repository with optional rebase.
    export async function handleGitPull({
      repo_path,
      remote = "origin",
      branch = null,
      rebase = false,
    }) {
      try {
        const git = simpleGit(repo_path);
    
        // If no branch specified, use current branch
        if (!branch) {
          const branchInfo = await git.branch();
          branch = branchInfo.current;
        }
    
        // Set up pull options
        const pullOptions = {};
        if (rebase) {
          pullOptions["--rebase"] = null;
        }
    
        // Perform the pull
        const pullResult = await git.pull(remote, branch, pullOptions);
    
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(
                {
                  success: true,
                  result: pullResult,
                  message: `Pulled from ${remote}/${branch}`,
                },
                null,
                2
              ),
            },
          ],
        };
      } catch (error) {
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(
                {
                  error: `Failed to pull changes: ${error.message}`,
                  conflicts: error.git ? error.git.conflicts : null,
                },
                null,
                2
              ),
            },
          ],
          isError: true,
        };
      }
  • Input schema definition for the git_pull tool, defining parameters like repo_path, remote, branch, and rebase.
    name: "git_pull",
    description: "Pull changes from a remote repository.",
    inputSchema: {
      type: "object",
      properties: {
        repo_path: {
          type: "string",
          description: "The path to the local Git repository",
        },
        remote: {
          type: "string",
          description: "Remote name",
          default: "origin",
        },
        branch: {
          type: "string",
          description: "Branch to pull (default: current branch)",
        },
        rebase: {
          type: "boolean",
          description: "Whether to rebase instead of merge",
          default: false,
        },
      },
      required: ["repo_path"],
    },
  • src/server.js:913-913 (registration)
    Registration of the git_pull handler in the server's handlersMap.
    git_pull: handleGitPull,
  • Re-export of handleGitPull from remote-operations.js for use in server.js
    handleGitPull,
  • src/server.js:891-891 (registration)
    Alias mapping git_fetch to git_pull tool.
    git_fetch: "git_pull",
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 action but doesn't disclose behavioral traits such as what happens on conflicts, whether it requires network access, if it modifies the working directory, or potential side effects. For a mutation tool with zero annotation coverage, this is a significant gap in transparency.

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 with zero waste. It's front-loaded with the core action and target, making it easy to parse. Every word earns its place, and there's no redundant or verbose phrasing.

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 4 parameters) and lack of annotations or output schema, the description is incomplete. It doesn't cover behavioral aspects like error handling, return values, or dependencies. For a Git pull tool, which can have significant side effects, more context is needed to guide safe usage.

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 all parameters (repo_path, remote, branch, rebase). The description adds no additional meaning beyond what the schema provides, such as explaining parameter interactions or default behaviors. Baseline 3 is appropriate when the schema does the heavy lifting.

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 ('Pull changes') and target ('from a remote repository'), which is specific and unambiguous. It distinguishes from siblings like git_push (which pushes changes) and git_merge_branch (which merges locally), though it doesn't explicitly name alternatives. The purpose is well-defined but lacks explicit sibling differentiation.

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., having a remote configured), when not to use it (e.g., if there are uncommitted changes), or refer to related tools like git_fetch or git_merge. Usage is implied by the action but without explicit context.

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