Skip to main content
Glama

my-project-repo_get_push_history

Retrieve recent push history to verify changes haven't been pushed before proceeding with batch Git operations.

Instructions

[My Awesome Project] Get the last 5 push history records for repository "my-project-repo". This tool MUST be called before using mgit_push to ensure the current changes have not been pushed before. After calling this tool, you can proceed with mgit_push.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler function that implements the logic for the 'my-project-repo_get_push_history' tool. It marks push history as checked and returns the last 5 records from in-memory pushHistory array.
    async get_push_history(params) {
      // Mark that push history has been checked
      this.hasCheckedPushHistory = true;
    
      // Return last 5 push records
      const last5Records = pushHistory.slice(0, 5);
    
      return {
        total: pushHistory.length,
        records: last5Records,
        message: last5Records.length > 0 
          ? `Found ${last5Records.length} recent push record(s). Please review them to ensure your current changes have not been pushed before. After reviewing, you can proceed with mgit_push.`
          : 'No push history found. This appears to be the first push. You can now proceed with mgit_push.'
      };
    }
  • Registration of the tool in the 'tools/list' method response. The name is dynamically set to '${REPO_NAME}_get_push_history' (e.g., 'my-project-repo_get_push_history') if REPO_NAME is set. Includes schema (empty input).
    // Only include get_push_history tool if CHECK_PUSH_HISTORY is enabled
    if (CHECK_PUSH_HISTORY) {
      tools.push({
        name: getToolName('get_push_history'),
        description: getToolDescription(`Get the last 5 push history records for repository "${REPO_NAME}". This tool MUST be called before using mgit_push to ensure the current changes have not been pushed before. After calling this tool, you can proceed with mgit_push.`),
        inputSchema: {
          type: 'object',
          properties: {}
        }
      });
    }
  • Helper function that prefixes tool names with REPO_NAME, creating 'my-project-repo_get_push_history' from 'get_push_history'.
    const getToolName = (baseName) => {
      return REPO_NAME ? `${REPO_NAME}_${baseName}` : baseName;
  • Helper that records new push entries to the in-memory pushHistory array (used after mgit_push).
    const recordPushHistory = (message, result, error = null) => {
      const pushEntry = {
        id: Date.now(),
        timestamp: new Date().toISOString(),
        repo_name: REPO_NAME,
        message: message,
        success: !error,
        error: error ? error.toString() : null,
        exit_code: result ? result.exitCode : null
      };
    
      pushHistory.unshift(pushEntry);
      if (pushHistory.length > MAX_PUSH_HISTORY) {
        pushHistory.splice(MAX_PUSH_HISTORY);
      }
    
      savePushHistory();
    };
  • In-memory storage for push history records, used by the get_push_history handler.
    const pushHistory = [];
Behavior3/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 describes the tool's behavior as retrieving 'the last 5 push history records', which implies a read-only operation, but does not disclose other behavioral traits such as error handling, rate limits, or authentication needs. The description adds some context about its role in a workflow but lacks details on operational constraints.

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 three sentences long. The first sentence clearly states the purpose, but the second and third sentences are somewhat repetitive in emphasizing the tool's mandatory use before mgit_push. While front-loaded with key information, it could be more concise by combining the usage instructions into a single, streamlined sentence.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (simple read operation with no parameters) and lack of annotations or output schema, the description is moderately complete. It explains the purpose and usage guidelines well but omits details on output format, error cases, or other behavioral aspects. For a tool with no structured data support, it provides a basic but incomplete picture.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description does not add parameter information beyond the schema, but since there are no parameters, this is acceptable. A baseline of 4 is appropriate as the description compensates by explaining the tool's fixed scope ('last 5' records) without needing to detail parameters.

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's purpose: 'Get the last 5 push history records for repository "my-project-repo"'. It specifies the verb ('Get'), resource ('push history records'), and scope ('last 5'), but does not explicitly differentiate from sibling tools like 'my-project-repo_get_operation_logs', which might also retrieve logs but for different types of operations.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit usage guidelines: 'This tool MUST be called before using mgit_push to ensure the current changes have not been pushed before. After calling this tool, you can proceed with mgit_push.' It clearly states when to use it (before mgit_push) and references an alternative (mgit_push) for the next step, offering strong guidance on workflow integration.

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/liliangshan/mcp-server-mgit'

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