Skip to main content
Glama

pull

Pull changes from a specified remote repository branch using Git MCP Server. Ensure your local repository is updated by specifying the branch and remote name.

Instructions

Pull changes from remote

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
branchYesBranch name
pathNoPath to repository. MUST be an absolute path (e.g., /Users/username/projects/my-repo)
remoteNoRemote nameorigin

Implementation Reference

  • Core handler function that implements the 'pull' tool logic: validates repository and remote, executes 'git pull remote branch' command, handles caching and returns formatted output.
    static async pull({ path, remote = 'origin', branch }: PushPullOptions, context: GitToolContext): Promise<GitToolResult> {
      const resolvedPath = this.getPath({ path });
      return await this.executeOperation(
        context.operation,
        resolvedPath,
        async () => {
          const { path: repoPath } = PathValidator.validateGitRepo(resolvedPath);
          await RepositoryValidator.validateRemoteConfig(repoPath, remote, context.operation);
          
          const result = await CommandExecutor.executeGitCommand(
            `pull ${remote} ${branch}`,
            context.operation,
            repoPath
          );
    
          return {
            content: [{
              type: 'text',
              text: `Changes pulled successfully\n${CommandExecutor.formatOutput(result)}`
            }]
          };
        },
        {
          command: 'pull',
          invalidateCache: true // Invalidate all caches
        }
      );
    }
  • Registers the 'pull' tool with the MCP server, specifying its name, description, and input schema.
    {
      name: 'pull',
      description: 'Pull changes from remote',
      inputSchema: {
        type: 'object',
        properties: {
          path: {
            type: 'string',
            description: `Path to repository. ${PATH_DESCRIPTION}`,
          },
          remote: {
            type: 'string',
            description: 'Remote name',
            default: 'origin',
          },
          branch: {
            type: 'string',
            description: 'Branch name',
          },
        },
        required: ['branch'],
      },
    },
  • Tool executor handler that validates input arguments using isPushPullOptions and delegates to GitOperations.pull.
    case 'pull': {
      const validArgs = this.validateArguments(operation, args, isPushPullOptions);
      return await GitOperations.pull(validArgs, context);
    }
  • Type definition for PushPullOptions used as input schema for 'pull' and 'push' tools.
    export interface PushPullOptions extends GitOptions, BasePathOptions {
      remote?: string;
      branch: string;
      force?: boolean;  // Allow force push/pull
      noVerify?: boolean;  // Skip pre-push/pre-pull hooks
      tags?: boolean;  // Include tags
    }
  • Type guard function used to validate arguments for 'pull' tool.
    export function isPushPullOptions(obj: any): obj is PushPullOptions {
      return obj && 
        validatePath(obj.path) && 
        typeof obj.branch === 'string';
    }
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. 'Pull changes from remote' implies a read/write operation that merges remote changes into the local branch, but it doesn't disclose critical behaviors like: whether it requires network connectivity, what happens on conflicts, if it modifies the working directory, or authentication needs. This is inadequate for a mutation tool with zero 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, efficient sentence with zero wasted words. It's front-loaded with the core purpose and appropriately sized for a tool with good schema coverage.

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 Git pull operation with 3 parameters, no annotations, and no output schema, the description is incomplete. It lacks information about what the tool returns (e.g., success/failure, merge results), error conditions, side effects, or typical workflow context. This leaves significant gaps for an agent to use it 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?

Schema description coverage is 100%, so parameters are well-documented in the schema itself. The description adds no parameter-specific information beyond what's in the schema (e.g., it doesn't explain the relationship between branch, path, and remote, or typical values). Baseline 3 is appropriate when the schema handles parameter documentation.

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 'Pull changes from remote' clearly states the action (pull) and target (changes from remote), which is specific to Git operations. It distinguishes from siblings like 'push' (which sends changes) and 'clone' (which copies entire repository), but doesn't explicitly differentiate from similar tools like 'fetch' (not in sibling list).

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 an existing repository with a remote configured), when not to use it, or how it compares to similar Git operations like 'fetch' (which retrieves changes without merging).

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

Related 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/Sheshiyer/git-mcp-v2'

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