Skip to main content
Glama
Arcia125

Git Workflow Automation MCP Server

by Arcia125

complete_git_workflow

Automate Git workflows by committing files, pushing changes, creating pull requests, and merging with GitHub authentication handling.

Instructions

Execute complete Git workflow: commit, push, create PR, and optionally merge

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filesNoFiles to commit
commitMessageYesCommit message (conventional format)
prTitleYesPull request title
prBodyYesPull request description
branchNoFeature branch name
baseBranchNoBase branchmain
autoMergeNoAutomatically merge PR after creation
workingDirNoWorking directory path
dryRunNoPreview without executing

Implementation Reference

  • The primary handler function that implements the complete_git_workflow tool logic, orchestrating commit/push, PR creation, and optional auto-merge.
    async function completeGitWorkflow(
      files: string[],
      commitMessage: string,
      prTitle: string,
      prBody: string,
      branch?: string,
      baseBranch: string = 'main',
      autoMerge: boolean = false,
      workingDir?: string,
      dryRun: boolean = false
    ): Promise<WorkflowResult> {
      try {
        if (dryRun) {
          return {
            success: true,
            message: "Dry run: Would execute complete Git workflow",
            details: {
              files,
              commitMessage,
              prTitle,
              prBody,
              branch,
              baseBranch,
              autoMerge
            }
          };
        }
    
        // Step 1: Commit and push
        const commitResult = await commitAndPush(files, commitMessage, branch, workingDir);
        if (!commitResult.success) {
          return commitResult;
        }
    
        // Step 2: Create pull request
        const prResult = await createPullRequest(prTitle, prBody, baseBranch, branch, workingDir);
        if (!prResult.success) {
          return prResult;
        }
    
        let mergeResult = null;
        if (autoMerge && prResult.details?.url) {
          // Extract PR number from URL
          const prMatch = prResult.details.url.match(/\/pull\/(\d+)$/);
          if (prMatch) {
            const prNumber = prMatch[1];
            mergeResult = await mergePullRequest(prNumber, 'merge', true, workingDir);
          }
        }
    
        return {
          success: true,
          message: "Successfully completed Git workflow",
          details: {
            commit: commitResult.details,
            pullRequest: prResult.details,
            merge: mergeResult?.details
          }
        };
      } catch (error: any) {
        return {
          success: false,
          message: "Git workflow failed",
          error: `Git workflow failed: ${error.message}`
        };
      }
    }
  • Input schema for the complete_git_workflow tool, defining parameters and validation rules.
    inputSchema: {
      type: "object",
      properties: {
        files: {
          type: "array",
          items: { type: "string" },
          description: "Files to commit"
        },
        commitMessage: {
          type: "string",
          description: "Commit message (conventional format)"
        },
        prTitle: {
          type: "string",
          description: "Pull request title"
        },
        prBody: {
          type: "string",
          description: "Pull request description"
        },
        branch: {
          type: "string",
          description: "Feature branch name"
        },
        baseBranch: {
          type: "string",
          description: "Base branch",
          default: "main"
        },
        autoMerge: {
          type: "boolean",
          description: "Automatically merge PR after creation",
          default: false
        },
        workingDir: {
          type: "string",
          description: "Working directory path"
        },
        dryRun: {
          type: "boolean",
          description: "Preview without executing",
          default: false
        }
      },
      required: ["commitMessage", "prTitle", "prBody"]
    }
  • src/index.ts:521-570 (registration)
    Tool registration in the ListToolsRequestSchema handler, including name, description, and schema.
    {
      name: "complete_git_workflow",
      description: "Execute complete Git workflow: commit, push, create PR, and optionally merge",
      inputSchema: {
        type: "object",
        properties: {
          files: {
            type: "array",
            items: { type: "string" },
            description: "Files to commit"
          },
          commitMessage: {
            type: "string",
            description: "Commit message (conventional format)"
          },
          prTitle: {
            type: "string",
            description: "Pull request title"
          },
          prBody: {
            type: "string",
            description: "Pull request description"
          },
          branch: {
            type: "string",
            description: "Feature branch name"
          },
          baseBranch: {
            type: "string",
            description: "Base branch",
            default: "main"
          },
          autoMerge: {
            type: "boolean",
            description: "Automatically merge PR after creation",
            default: false
          },
          workingDir: {
            type: "string",
            description: "Working directory path"
          },
          dryRun: {
            type: "boolean",
            description: "Preview without executing",
            default: false
          }
        },
        required: ["commitMessage", "prTitle", "prBody"]
      }
    }
  • src/index.ts:616-628 (registration)
    Dispatch/registration of the complete_git_workflow handler in the CallToolRequestSchema switch statement.
    case "complete_git_workflow":
      result = await completeGitWorkflow(
        (args?.files as string[]) || [],
        args?.commitMessage as string,
        args?.prTitle as string,
        args?.prBody as string,
        args?.branch as string,
        (args?.baseBranch as string) || 'main',
        (args?.autoMerge as boolean) || false,
        args?.workingDir as string,
        (args?.dryRun as boolean) || false
      );
      break;
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions the sequence of actions (commit, push, create PR, optionally merge) but lacks details on permissions required, error handling, rate limits, or what happens in edge cases (e.g., merge conflicts). This is inadequate for a complex, multi-step tool with potential side effects.

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 that front-loads the core purpose ('Execute complete Git workflow') and lists key actions without unnecessary details. Every word earns its place, making it highly concise and well-structured.

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 tool's complexity (9 parameters, no annotations, no output schema, and multi-step operations), the description is insufficient. It lacks information on return values, error conditions, dependencies, or how it integrates with sibling tools, leaving significant gaps for an AI agent to understand and invoke 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 the schema already documents all 9 parameters thoroughly. The description adds no additional parameter semantics beyond implying the tool's overall workflow, which doesn't enhance understanding of individual parameters. Baseline 3 is appropriate as the schema does the heavy lifting.

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

Purpose5/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 with specific verbs (execute, commit, push, create, merge) and resources (Git workflow, PR). It distinguishes from sibling tools by combining multiple operations (commit, push, create PR, merge) that are handled separately by siblings like create_pull_request, git_commit_and_push, and merge_pull_request.

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

Usage Guidelines4/5

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

The description implies usage context by mentioning 'complete Git workflow' and 'optionally merge,' suggesting it's for end-to-end operations. However, it doesn't explicitly state when to use this tool versus the sibling tools (e.g., for batch workflows vs. individual steps), nor does it mention prerequisites or exclusions, leaving some ambiguity.

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/Arcia125/git-workflow-mcp-server'

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