Skip to main content
Glama

git-update

Update Git projects with history tracking, changelog generation, and multi-provider synchronization. Perform updates, rollbacks, comparisons, and track changes across repositories.

Instructions

Advanced project update tool with history tracking, changelog generation, and multi-provider synchronization

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionYesUpdate operation to perform
authorNoFilter by author
autoCommitNoAutomatically commit changes
changelogPathNoPath to changelog file
commitMessageNoCustom commit message
compareTypeNoType of comparison target
compareWithNoTarget to compare with
createTagNoCreate a tag after update
forceSyncNoForce synchronization
formatNoOutput format for history
groupByTypeNoGroup changelog entries by type
includeCommitsNoInclude commit details in changelog
projectPathYesPath to the Git repository
providerNoProvider for remote operations
providersNoProviders to sync with
rollbackToNoTarget for rollback (commit, tag, or version)
rollbackTypeNoType of rollback target
sinceNoStart date for history (ISO format or relative)
tagNameNoName for the tag
trackFileNoFile to track for changes
trackPatternNoPattern to track for changes
untilNoEnd date for history (ISO format or relative)
updateTypeNoType of update to perform
versionNoVersion for changelog entry
watchModeNoEnable watch mode for tracking

Implementation Reference

  • Main handler function for the git-update tool. Validates parameters and dispatches to action-specific handlers like update, history, changelog, etc.
    async execute(params: GitUpdateParams): Promise<ToolResult> {
      const startTime = Date.now();
      this.logger.info(`Executing git-update ${params.action}`);
    
      try {
        // Validate parameters
        const validation = ParameterValidator.validateToolParams('git-update', params);
        if (!validation.isValid) {
          return OperationErrorHandler.createToolError(
            'VALIDATION_ERROR',
            'Parameter validation failed',
            params.action,
            validation,
            validation.suggestions
          );
        }
    
        // Route to appropriate handler
        switch (params.action) {
          case 'update':
            return await this.handleUpdate(params, startTime);
          case 'history':
            return await this.handleHistory(params, startTime);
          case 'changelog':
            return await this.handleChangelog(params, startTime);
          case 'track':
            return await this.handleTrack(params, startTime);
          case 'sync-providers':
            return await this.handleSyncProviders(params, startTime);
          case 'status':
            return await this.handleStatus(params, startTime);
          case 'rollback':
            return await this.handleRollback(params, startTime);
          case 'compare':
            return await this.handleCompare(params, startTime);
          default:
            return OperationErrorHandler.createToolError(
              'UNSUPPORTED_OPERATION',
              `Update operation '${params.action}' is not supported`,
              params.action,
              {},
              ['Use one of: update, history, changelog, track, sync-providers, status, rollback, compare']
            );
        }
      } catch (error) {
        this.logger.error('Error executing git-update');
        return OperationErrorHandler.createToolError(
          'EXECUTION_ERROR',
          `Failed to execute git-update ${params.action}: ${error instanceof Error ? error.message : 'Unknown error'}`,
          params.action,
          { error: error instanceof Error ? error.message : String(error) },
          ['Check project path and Git repository status']
        );
      }
    }
  • Static method providing the complete JSON schema for the git-update tool, including all input parameters and their types.
    static getToolSchema() {
      return {
        name: 'git-update',
        description: 'Advanced project update tool with history tracking, changelog generation, and multi-provider synchronization',
        inputSchema: {
          type: 'object',
          properties: {
            action: {
              type: 'string',
              enum: ['update', 'history', 'changelog', 'track', 'sync-providers', 'status', 'rollback', 'compare'],
              description: 'Update operation to perform'
            },
            projectPath: {
              type: 'string',
              description: 'Path to the Git repository'
            },
            provider: {
              type: 'string',
              enum: ['github', 'gitea', 'both'],
              description: 'Provider for remote operations'
            },
            updateType: {
              type: 'string',
              enum: ['all', 'dependencies', 'code', 'docs', 'config'],
              description: 'Type of update to perform'
            },
            autoCommit: {
              type: 'boolean',
              description: 'Automatically commit changes'
            },
            commitMessage: {
              type: 'string',
              description: 'Custom commit message'
            },
            createTag: {
              type: 'boolean',
              description: 'Create a tag after update'
            },
            tagName: {
              type: 'string',
              description: 'Name for the tag'
            },
            since: {
              type: 'string',
              description: 'Start date for history (ISO format or relative)'
            },
            until: {
              type: 'string',
              description: 'End date for history (ISO format or relative)'
            },
            author: {
              type: 'string',
              description: 'Filter by author'
            },
            format: {
              type: 'string',
              enum: ['json', 'markdown', 'text'],
              description: 'Output format for history'
            },
            changelogPath: {
              type: 'string',
              description: 'Path to changelog file'
            },
            version: {
              type: 'string',
              description: 'Version for changelog entry'
            },
            includeCommits: {
              type: 'boolean',
              description: 'Include commit details in changelog'
            },
            groupByType: {
              type: 'boolean',
              description: 'Group changelog entries by type'
            },
            trackFile: {
              type: 'string',
              description: 'File to track for changes'
            },
            trackPattern: {
              type: 'string',
              description: 'Pattern to track for changes'
            },
            watchMode: {
              type: 'boolean',
              description: 'Enable watch mode for tracking'
            },
            providers: {
              type: 'array',
              items: { type: 'string' },
              description: 'Providers to sync with'
            },
            forceSync: {
              type: 'boolean',
              description: 'Force synchronization'
            },
            rollbackTo: {
              type: 'string',
              description: 'Target for rollback (commit, tag, or version)'
            },
            rollbackType: {
              type: 'string',
              enum: ['commit', 'tag', 'version'],
              description: 'Type of rollback target'
            },
            compareWith: {
              type: 'string',
              description: 'Target to compare with'
            },
            compareType: {
              type: 'string',
              enum: ['commit', 'tag', 'branch', 'provider'],
              description: 'Type of comparison target'
            }
          },
          required: ['action', 'projectPath']
        }
      };
    }
  • src/server.ts:504-505 (registration)
    Registration and dispatch in the main server executeTool switch statement. Calls gitUpdateTool.execute() when 'git-update' is requested.
    case 'git-update':
      return await this.gitUpdateTool.execute(args);
  • src/server.ts:110-110 (registration)
    Instantiation of GitUpdateTool instance during server initialization with provider configuration.
    this.gitUpdateTool = new GitUpdateTool(providerConfig);
  • src/server.ts:142-146 (registration)
    Tool schema registration in the ListTools handler response array.
          GitUpdateTool.getToolSchema(),
          GitHistoryTool.getToolSchema()
        ]
      };
    });
  • Helper validation method specific to git-update tool parameters and actions.
    private static validateUpdateParams(action: string, params: ToolParams): ValidationResult {
      const result: ValidationResult = {
        isValid: true,
        errors: [],
        warnings: [],
        suggestions: []
      };
    
      switch (action) {
        case 'update':
          if (params.updateType && !['all', 'dependencies', 'code', 'docs', 'config'].includes(params.updateType)) {
            result.errors.push('Invalid update type. Must be one of: all, dependencies, code, docs, config');
            result.suggestions.push('Use updateType: "all", "dependencies", "code", "docs", or "config"');
            result.isValid = false;
          }
          break;
        case 'history':
          if (params.format && !['json', 'markdown', 'text'].includes(params.format)) {
            result.errors.push('Invalid format. Must be one of: json, markdown, text');
            result.suggestions.push('Use format: "json", "markdown", or "text"');
            result.isValid = false;
          }
          break;
        case 'changelog':
          if (params.version && !/^[\d]+\.[\d]+\.[\d]+/.test(params.version)) {
            result.warnings.push('Version format should follow semantic versioning (e.g., 1.0.0)');
          }
          break;
        case 'track':
          if (!params.trackFile && !params.trackPattern) {
            result.warnings.push('No specific file or pattern to track - will track all changes');
          }
          break;
        case 'sync-providers':
          if (params.providers && Array.isArray(params.providers)) {
            const validProviders = ['github', 'gitea'];
            const invalidProviders = params.providers.filter(p => !validProviders.includes(p));
            if (invalidProviders.length > 0) {
              result.errors.push(`Invalid providers: ${invalidProviders.join(', ')}`);
              result.suggestions.push('Use providers: "github", "gitea", or both');
              result.isValid = false;
            }
          }
          break;
        case 'rollback':
          if (!params.rollbackTo) {
            result.errors.push('rollbackTo parameter is required for rollback operation');
            result.suggestions.push('Provide a commit hash, tag name, or version to rollback to');
            result.isValid = false;
          }
          if (params.rollbackType && !['commit', 'tag', 'version'].includes(params.rollbackType)) {
            result.errors.push('Invalid rollback type. Must be one of: commit, tag, version');
            result.suggestions.push('Use rollbackType: "commit", "tag", or "version"');
            result.isValid = false;
          }
          break;
        case 'compare':
          if (!params.compareWith) {
            result.errors.push('compareWith parameter is required for compare operation');
            result.suggestions.push('Provide a commit hash, tag name, branch, or provider to compare with');
            result.isValid = false;
          }
          if (params.compareType && !['commit', 'tag', 'branch', 'provider'].includes(params.compareType)) {
            result.errors.push('Invalid compare type. Must be one of: commit, tag, branch, provider');
            result.suggestions.push('Use compareType: "commit", "tag", "branch", or "provider"');
            result.isValid = false;
          }
          break;
        case 'status':
          // Status operation has no specific validation requirements
          break;
      }
    
      return result;
    }
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. While it mentions capabilities like 'history tracking' and 'changelog generation,' it doesn't explain what these operations actually do, whether they're read-only or mutating, what permissions are required, or how errors are handled. For a complex tool with 25 parameters, this is inadequate behavioral transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that packs substantial information about capabilities. It's appropriately sized for a complex tool, though it could be slightly more structured by separating the three main capabilities for better readability.

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 highly complex tool with 25 parameters, no annotations, and no output schema, the description is insufficient. It doesn't explain the relationship between the various capabilities, doesn't clarify whether this is primarily a read or write tool, and provides no guidance on the expected output format or behavior. The description fails to compensate for the lack of structured metadata.

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 already documents all 25 parameters thoroughly. The description adds no specific parameter information beyond the high-level capabilities mentioned. The baseline of 3 is appropriate when the schema does all the parameter documentation work.

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 tool performs project updates with specific capabilities (history tracking, changelog generation, multi-provider synchronization), which is a clear verb+resource statement. However, it doesn't explicitly differentiate from sibling tools like git-sync or git-workflow, which might have overlapping functionality.

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. With many sibling tools available (git-sync, git-workflow, git-monitor, etc.), there's no indication of which scenarios warrant this 'advanced project update tool' versus simpler alternatives or specialized tools.

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/Andre-Buzeli/git-mcp'

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