Skip to main content
Glama

git-monitor

Monitor Git repository activity by tracking logs, status changes, commit history, and contributor analysis to maintain project oversight and identify development patterns.

Instructions

Git monitoring and logging tool for log, status, commits, and contributors operations. Provides comprehensive repository analysis and monitoring capabilities.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionYesThe Git monitoring operation to perform
authorNoFilter by author name or email
branchNoBranch to analyze (default: current branch)
detailedNoShow detailed status information (for status operation)
formatNoCommit format (for commits operation)
graphNoShow commit graph (for commits operation)
grepNoFilter by commit message pattern
includeStatsNoInclude detailed statistics (insertions/deletions)
limitNoNumber of commits to show (1-1000, default: 10 for log, 50 for commits)
projectPathYesAbsolute path to the project directory
sinceNoDate since when to show logs (e.g., "2024-01-01", "1 week ago")
sortByNoSort contributors by (for contributors operation)
untilNoDate until when to show logs (e.g., "2024-01-01", "1 week ago")

Implementation Reference

  • Primary handler function for the git-monitor tool. Validates parameters and routes to specific operation handlers: log, status, commits, contributors.
    async execute(params: GitMonitorParams): Promise<ToolResult> {
      const startTime = Date.now();
    
      try {
        // Validate basic parameters
        const validation = ParameterValidator.validateToolParams('git-monitor', params);
        if (!validation.isValid) {
          return OperationErrorHandler.createToolError(
            'VALIDATION_ERROR',
            `Parameter validation failed: ${validation.errors.join(', ')}`,
            params.action,
            { validationErrors: validation.errors },
            validation.suggestions
          );
        }
    
        // Validate operation-specific parameters
        const operationValidation = this.validateOperationParams(params);
        if (!operationValidation.isValid) {
          return OperationErrorHandler.createToolError(
            'VALIDATION_ERROR',
            `Operation validation failed: ${operationValidation.errors.join(', ')}`,
            params.action,
            { validationErrors: operationValidation.errors },
            operationValidation.suggestions
          );
        }
    
        // Route to appropriate handler
        switch (params.action) {
          case 'log':
            return await this.handleLog(params, startTime);
          case 'status':
            return await this.handleStatus(params, startTime);
          case 'commits':
            return await this.handleCommits(params, startTime);
          case 'contributors':
            return await this.handleContributors(params, startTime);
          default:
            return OperationErrorHandler.createToolError(
              'UNSUPPORTED_OPERATION',
              `Operation '${params.action}' is not supported`,
              params.action,
              {},
              ['Use one of: log, status, commits, contributors']
            );
        }
    
      } catch (error) {
        const errorMessage = error instanceof Error ? error.message : 'Unknown error';
        return OperationErrorHandler.createToolError(
          'EXECUTION_ERROR',
          `Failed to execute ${params.action}: ${errorMessage}`,
          params.action,
          { error: errorMessage },
          ['Check the error details and try again']
        );
      }
    }
  • JSON schema definition for git-monitor tool inputs, including all parameters, types, enums, and descriptions for validation.
    static getToolSchema() {
      return {
        name: 'git-monitor',
        description: 'Git monitoring and logging tool for log, status, commits, and contributors operations. Provides comprehensive repository analysis and monitoring capabilities.',
        inputSchema: {
          type: 'object',
          properties: {
            action: {
              type: 'string',
              enum: ['log', 'status', 'commits', 'contributors'],
              description: 'The Git monitoring operation to perform'
            },
            projectPath: {
              type: 'string',
              description: 'Absolute path to the project directory'
            },
            limit: {
              type: 'number',
              description: 'Number of commits to show (1-1000, default: 10 for log, 50 for commits)',
              minimum: 1,
              maximum: 1000
            },
            branch: {
              type: 'string',
              description: 'Branch to analyze (default: current branch)'
            },
            since: {
              type: 'string',
              description: 'Date since when to show logs (e.g., "2024-01-01", "1 week ago")'
            },
            until: {
              type: 'string',
              description: 'Date until when to show logs (e.g., "2024-01-01", "1 week ago")'
            },
            author: {
              type: 'string',
              description: 'Filter by author name or email'
            },
            grep: {
              type: 'string',
              description: 'Filter by commit message pattern'
            },
            detailed: {
              type: 'boolean',
              description: 'Show detailed status information (for status operation)'
            },
            format: {
              type: 'string',
              enum: ['short', 'full', 'oneline', 'raw'],
              description: 'Commit format (for commits operation)'
            },
            graph: {
              type: 'boolean',
              description: 'Show commit graph (for commits operation)'
            },
            sortBy: {
              type: 'string',
              enum: ['commits', 'lines', 'name'],
              description: 'Sort contributors by (for contributors operation)'
            },
            includeStats: {
              type: 'boolean',
              description: 'Include detailed statistics (insertions/deletions)'
            }
          },
          required: ['action', 'projectPath']
        }
      };
    }
  • src/server.ts:492-493 (registration)
    Registration and dispatch in the main server tool execution switch statement, calling GitMonitorTool.execute.
    case 'git-monitor':
      return await this.gitMonitorTool.execute(args);
  • src/server.ts:136-136 (registration)
    Tool schema registration in the listTools handler for MCP tool discovery.
    GitMonitorTool.getToolSchema(),
  • Helper validation configuration defining supported actions for git-monitor and confirming local-only operations (no remote).
    private static readonly TOOL_OPERATIONS: Record<string, string[]> = {
      'git-workflow': ['init', 'commit', 'sync', 'status', 'backup', 'push', 'pull', 'create', 'list', 'get', 'update', 'delete', 'fork', 'search'],
      'git-files': ['read', 'search', 'backup', 'list'],
      'git-branches': ['create', 'list', 'get', 'delete', 'merge', 'compare'],
      'git-issues': ['create', 'list', 'get', 'update', 'close', 'comment', 'search'],
      'git-pulls': ['create', 'list', 'get', 'update', 'merge', 'close', 'review', 'search'],
      'git-tags': ['create', 'list', 'get', 'delete', 'search'],
      'git-release': ['create', 'list', 'get', 'update', 'delete', 'publish', 'download'],
      'git-remote': ['add', 'remove', 'rename', 'show', 'set-url', 'prune', 'list'],
      'git-reset': ['soft', 'mixed', 'hard', 'reset-to-commit', 'reset-branch'],
      'git-stash': ['stash', 'pop', 'apply', 'list', 'show', 'drop', 'clear'],
      'git-config': ['get', 'set', 'unset', 'list', 'edit', 'show'],
      'git-monitor': ['log', 'status', 'commits', 'contributors'],
      'git-backup': ['backup', 'restore', 'list', 'verify'],
      'git-archive': ['create', 'extract', 'list', 'verify'],
      'git-packages': ['list', 'get', 'create', 'update', 'delete', 'publish', 'download'],
      'git-analytics': ['stats', 'commits', 'contributors'],
      'git-sync': ['sync', 'status'],
      'git-update': ['update', 'history', 'changelog', 'track', 'sync-providers', 'status', 'rollback', 'compare'],
      'git-history': ['log', 'track', 'sync', 'export', 'auto']
    };
    
    private static readonly REMOTE_OPERATIONS: Record<string, string[]> = {
      'git-workflow': ['create', 'list', 'get', 'update', 'delete', 'fork', 'search'],
    // git-files operations are local by default, remote only when provider is explicitly specified (read-only only)
    'git-files': [],
      'git-branches': [], // All branch operations are local for now
      'git-issues': ['create', 'list', 'get', 'update', 'close', 'comment', 'search'],
      'git-pulls': ['create', 'list', 'get', 'update', 'merge', 'close', 'review', 'search'],
      'git-tags': [], // All tag operations are local
      'git-release': ['create', 'list', 'get', 'update', 'delete', 'publish', 'download'],
      'git-remote': [], // Remote operations are local Git commands
      'git-reset': [], // Reset operations are local
      'git-stash': [], // Stash operations are local
      'git-config': [], // Config operations are local
      'git-monitor': [], // Monitor operations are local
      'git-backup': [], // Backup operations are local
      'git-archive': [], // Archive operations are local
      'git-packages': ['create', 'update', 'delete', 'publish', 'download'], // list and get are local
      'git-analytics': [], // All analytics operations are local by default
      'git-sync': [], // All sync operations are local by default
      'git-update': ['sync-providers'], // Only sync-providers is remote
      'git-history': ['sync'] // sync operation can be remote when using API method
    };
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 'monitoring and logging' and 'analysis capabilities' but doesn't disclose critical traits like whether it's read-only, requires specific permissions, has rate limits, or what output to expect. This leaves significant gaps for a tool with 13 parameters and no output schema.

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

Conciseness3/5

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

The description is two sentences and front-loaded with the core purpose, but the second sentence ('Provides comprehensive repository analysis and monitoring capabilities') is vague and adds little value. It could be more structured by explicitly linking actions to use cases, but it avoids redundancy, earning a mid-range score.

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 complexity (13 parameters, no annotations, no output schema), the description is incomplete. It doesn't explain behavioral aspects, output expectations, or differentiation from siblings, leaving the agent under-informed. For a multi-operation tool with rich input schema, more context on usage and results 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 13 parameters with clear descriptions and enums. The description adds no additional parameter semantics beyond listing the action types (log, status, commits, contributors), which are already covered in the schema's enum for 'action'. Thus, it meets the baseline but doesn't enhance understanding.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states the tool is for 'Git monitoring and logging' with specific operations (log, status, commits, contributors), which is clear but vague about the exact functionality. It mentions 'comprehensive repository analysis and monitoring capabilities' but doesn't specify what distinguishes it from siblings like git-analytics or git-branches, leaving the purpose somewhat ambiguous.

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?

No explicit guidance on when to use this tool versus alternatives is provided. The description lists operations but doesn't explain contexts or prerequisites, such as when to choose this over git-analytics for analysis or git-log for logging. Without usage instructions, the agent must infer from the action parameter 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/Andre-Buzeli/git-mcp'

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