Skip to main content
Glama

git_branch_explained

Understand Git branch workflows by visualizing branches with clear explanations to manage development processes effectively.

Instructions

Show branches with explanation of branch workflow

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • src/index.js:81-103 (registration)
    MCP server.tool registration for 'git_branch_explained' tool, including empty input schema, description, and inline handler function.
    "git_branch_explained", "Show branches with explanation of branch workflow", {}, async () => { const result = await runCommand("git branch -a"); if (!result.success) { return { content: [{ type: "text", text: `Error: ${result.error}` }] }; } let output = `BRANCHES:\n${result.stdout}\n\n`; output += `BRANCH WORKFLOW:\n`; output += `1. main/master - Production code. Never commit directly here.\n`; output += `2. develop - Integration branch (if used). Features merge here first.\n`; output += `3. feature/* - Your working branches. Create with:\n`; output += ` git checkout -b feature/my-feature-name\n\n`; output += `TO CREATE A NEW BRANCH:\n`; output += ` git checkout -b feature/your-feature-name\n\n`; output += `TO SWITCH BRANCHES:\n`; output += ` git checkout branch-name\n`; return { content: [{ type: "text", text: output }] }; } );
  • Exported handler function gitBranchExplained (identical logic, likely for testing purposes). Uses commandRunner helper.
    export async function gitBranchExplained() { const result = await commandRunner("git branch -a"); if (!result.success) { return { content: [{ type: "text", text: `Error: ${result.error}` }] }; } let output = `BRANCHES:\n${result.stdout}\n\n`; output += `BRANCH WORKFLOW:\n`; output += `1. main/master - Production code. Never commit directly here.\n`; output += `2. develop - Integration branch (if used). Features merge here first.\n`; output += `3. feature/* - Your working branches. Create with:\n`; output += ` git checkout -b feature/my-feature-name\n\n`; output += `TO CREATE A NEW BRANCH:\n`; output += ` git checkout -b feature/your-feature-name\n\n`; output += `TO SWITCH BRANCHES:\n`; output += ` git checkout branch-name\n`; return { content: [{ type: "text", text: output }] }; }
  • src/tools.js:579-579 (registration)
    Inclusion in the exported 'tools' object (possibly for alternative registration or testing).
    gitBranchExplained,
  • Shared runCommand helper used by the git_branch_explained handler to execute shell commands safely.
    async function runCommand(cmd, options = {}) { try { const { stdout, stderr } = await execAsync(cmd, { timeout: 30000, ...options }); return { success: true, stdout: stdout.trim(), stderr: stderr.trim() }; } catch (error) { return { success: false, error: error.message, stdout: error.stdout?.trim(), stderr: error.stderr?.trim() }; } }
  • Empty input schema object indicating the tool takes no parameters.
    {},

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/rideRTD/RTD-DevOps'

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