Skip to main content
Glama

git_status_explained

Check git status with beginner-friendly explanations to understand repository changes and manage Git operations effectively.

Instructions

Check git status with beginner-friendly explanations

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main execution handler for the git_status_explained tool. It runs `git status --porcelain -b`, parses the branch and file status lines, maps status codes to explanations, formats an output string, and returns it as MCP content.
    async () => {
      const result = await runCommand("git status --porcelain -b");
      if (!result.success) {
        return { content: [{ type: "text", text: `Error: ${result.error}\n\nAre you in a git repository? Try: git init` }] };
      }
    
      const lines = result.stdout.split("\n").filter(Boolean);
      if (lines.length === 0) {
        return { content: [{ type: "text", text: "Not a git repository or empty output" }] };
      }
    
      const branchLine = lines[0];
      const fileLines = lines.slice(1);
    
      const meanings = {
        "??": "Untracked - New file, not yet tracked by git. Use 'git add <file>' to track it.",
        " M": "Modified - Changed but not staged. Use 'git add <file>' to stage it.",
        "M ": "Staged - Ready to be committed. Use 'git commit -m \"message\"' to commit.",
        "MM": "Modified & Staged - File was staged, then modified again.",
        "A ": "Added - New file, staged and ready to commit.",
        "D ": "Deleted - File was deleted. Stage with 'git add <file>'.",
        " D": "Deleted (unstaged) - File deleted but not staged.",
        "R ": "Renamed - File was renamed.",
        "C ": "Copied - File was copied.",
        "UU": "Conflict - Merge conflict! Edit the file to resolve.",
      };
    
      let output = `Branch: ${branchLine.replace("## ", "")}\n\n`;
    
      if (fileLines.length === 0) {
        output += "Working tree clean - no changes to commit.";
      } else {
        output += "Changes:\n";
        for (const line of fileLines) {
          const status = line.substring(0, 2);
          const file = line.substring(3);
          const meaning = meanings[status] || `Unknown status: ${status}`;
          output += `  ${file}\n    Status: ${meaning}\n\n`;
        }
      }
    
      return { content: [{ type: "text", text: output }] };
    }
  • Empty input schema object, indicating the tool takes no parameters.
    {},
  • src/index.js:31-78 (registration)
    Registration of the git_status_explained tool using McpServer.tool() with name, description, schema, and handler.
    server.tool(
      "git_status_explained",
      "Check git status with beginner-friendly explanations",
      {},
      async () => {
        const result = await runCommand("git status --porcelain -b");
        if (!result.success) {
          return { content: [{ type: "text", text: `Error: ${result.error}\n\nAre you in a git repository? Try: git init` }] };
        }
    
        const lines = result.stdout.split("\n").filter(Boolean);
        if (lines.length === 0) {
          return { content: [{ type: "text", text: "Not a git repository or empty output" }] };
        }
    
        const branchLine = lines[0];
        const fileLines = lines.slice(1);
    
        const meanings = {
          "??": "Untracked - New file, not yet tracked by git. Use 'git add <file>' to track it.",
          " M": "Modified - Changed but not staged. Use 'git add <file>' to stage it.",
          "M ": "Staged - Ready to be committed. Use 'git commit -m \"message\"' to commit.",
          "MM": "Modified & Staged - File was staged, then modified again.",
          "A ": "Added - New file, staged and ready to commit.",
          "D ": "Deleted - File was deleted. Stage with 'git add <file>'.",
          " D": "Deleted (unstaged) - File deleted but not staged.",
          "R ": "Renamed - File was renamed.",
          "C ": "Copied - File was copied.",
          "UU": "Conflict - Merge conflict! Edit the file to resolve.",
        };
    
        let output = `Branch: ${branchLine.replace("## ", "")}\n\n`;
    
        if (fileLines.length === 0) {
          output += "Working tree clean - no changes to commit.";
        } else {
          output += "Changes:\n";
          for (const line of fileLines) {
            const status = line.substring(0, 2);
            const file = line.substring(3);
            const meaning = meanings[status] || `Unknown status: ${status}`;
            output += `  ${file}\n    Status: ${meaning}\n\n`;
          }
        }
    
        return { content: [{ type: "text", text: output }] };
      }
    );
  • Helper function runCommand used by the handler to execute shell commands safely with timeout and error handling.
    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() };
      }
    }
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 'beginner-friendly explanations' which suggests educational output, but doesn't describe what the tool actually returns (e.g., formatted status, explanations of status codes, error handling). For a tool with zero annotation coverage, this leaves significant gaps in understanding its behavior.

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 communicates the core purpose without any wasted words. It's appropriately sized for a simple tool and front-loads the essential information ('Check git status').

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 has no annotations, no output schema, and the description is minimal, it's incomplete for effective use. While the purpose is clear, the agent lacks crucial information about what the tool returns, how it behaves, or any educational context beyond the phrase 'beginner-friendly explanations'. This creates uncertainty for tool selection and invocation.

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 tool has 0 parameters with 100% schema description coverage, so the schema already fully documents the lack of inputs. The description adds no parameter information, which is appropriate given there are none. A baseline of 4 is assigned for zero-parameter tools where the description doesn't need to compensate for schema gaps.

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 action ('Check git status') and adds a valuable qualifier ('with beginner-friendly explanations') that distinguishes it from a basic status command. However, it doesn't explicitly differentiate from sibling tools like 'git_branch_explained' or 'git_commit_guided', which prevents a perfect score.

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. There's no mention of when this tool is appropriate, what prerequisites might be needed, or how it compares to other git-related tools in the sibling list. The agent must infer usage from the name 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/rideRTD/RTD-DevOps'

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