Skip to main content
Glama
bsreeram08

Git Repo Browser MCP

git_lfs_fetch

Fetch Git LFS objects from remote repositories to manage large files in Git workflows, supporting dry runs and pointer conversion.

Instructions

Fetch LFS objects from the remote repository.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
repo_pathYesThe path to the local Git repository
dry_runNoWhether to perform a dry run
pointersNoWhether to convert pointers to objects

Implementation Reference

  • Core implementation of the git_lfs_fetch tool. Executes 'git lfs fetch' in the repository directory with optional --dry-run and --pointers flags using execPromise. Handles output parsing, errors, and special case for missing Git LFS installation.
    export async function handleGitLFSFetch({
      repo_path,
      dry_run = false,
      pointers = false,
    }) {
      try {
        // Build the command
        let command = `cd "${repo_path}" && git lfs fetch`;
    
        if (dry_run) {
          command += " --dry-run";
        }
    
        if (pointers) {
          command += " --pointers";
        }
    
        // Execute the command
        const { stdout, stderr } = await execPromise(command);
    
        // Parse the output
        const output = stdout.trim();
        const errors = stderr.trim();
    
        if (errors && !output) {
          return {
            content: [
              {
                type: "text",
                text: JSON.stringify({ error: errors }, null, 2),
              },
            ],
            isError: true,
          };
        }
    
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(
                {
                  success: true,
                  message: "Git LFS fetch completed",
                  output: output,
                  dry_run: dry_run,
                },
                null,
                2
              ),
            },
          ],
        };
      } catch (error) {
        // Special handling for "git lfs not installed" error
        if (error.message.includes("git: lfs is not a git command")) {
          return {
            content: [
              {
                type: "text",
                text: JSON.stringify(
                  { error: "Git LFS is not installed on the system" },
                  null,
                  2
                ),
              },
            ],
            isError: true,
          };
        }
    
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(
                { error: `Failed to fetch LFS objects: ${error.message}` },
                null,
                2
              ),
            },
          ],
          isError: true,
        };
      }
    }
  • Tool schema definition including name, description, and inputSchema with properties repo_path (required), dry_run, and pointers.
    {
      name: "git_lfs_fetch",
      description: "Fetch LFS objects from the remote repository.",
      inputSchema: {
        type: "object",
        properties: {
          repo_path: {
            type: "string",
            description: "The path to the local Git repository",
          },
          dry_run: {
            type: "boolean",
            description: "Whether to perform a dry run",
            default: false,
          },
          pointers: {
            type: "boolean",
            description: "Whether to convert pointers to objects",
            default: false,
          },
        },
        required: ["repo_path"],
      },
    },
  • src/server.js:925-925 (registration)
    Maps the tool name 'git_lfs_fetch' to its handler function handleGitLFSFetch in the central handlersMap used by the MCP server.
    git_lfs_fetch: handleGitLFSFetch,
  • src/server.js:36-38 (registration)
    Imports the handleGitLFSFetch function from handlers/index.js into the server module.
      handleGitLFSFetch,
      handleGitRevert,
    } from "./handlers/index.js";
  • Re-exports handleGitLFSFetch from other-operations.js for centralized import in server.js.
    handleGitLFSFetch,
Behavior2/5

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

With no annotations provided, the description carries full burden but offers minimal behavioral insight. It mentions fetching from a remote but doesn't disclose critical details like network requirements, error handling, what happens if objects already exist locally, or whether it modifies the working directory. This leaves significant gaps for agent understanding.

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, direct sentence with zero wasted words. It's front-loaded with the core action and target, making it highly efficient and easy to parse.

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?

For a tool with no annotations and no output schema, the description is insufficiently complete. It doesn't explain what 'fetching LFS objects' entails operationally, what the expected outcomes are, or how errors might manifest. Given the complexity of Git LFS operations and lack of structured context, more detail is needed.

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 three parameters. The description adds no additional parameter context beyond implying remote fetching, which is already covered by the tool name and purpose. This meets the baseline for high schema coverage.

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 ('fetch') and target ('LFS objects from the remote repository'), making the purpose immediately understandable. However, it doesn't explicitly differentiate from sibling tools like git_lfs or git_pull, which might have overlapping functionality with LFS operations.

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_lfs or git_pull, nor does it mention prerequisites (e.g., needing an LFS-configured repository or remote connectivity). It lacks context about typical use cases or exclusions.

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