Skip to main content
Glama
bsreeram08

Git Repo Browser MCP

git_commit

Create a Git commit with a specified message to save changes in a repository. This tool helps track project progress by recording modifications with descriptive messages.

Instructions

Create a commit with the specified message.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
repo_pathYesThe path to the local Git repository
messageYesThe commit message

Implementation Reference

  • The handler function that executes the git_commit tool: creates a commit in the specified repository using simpleGit.commit() on staged changes.
     * Creates a commit with the specified message
     * @param {string} repoPath - Path to the local repository
     * @param {string} message - Commit message
     * @returns {Object} - Commit result
     */
    export async function handleGitCommit({ repo_path, message }) {
      try {
        const git = simpleGit(repo_path);
    
        // Create the commit (only commit what's in the staging area)
        const commitResult = await git.commit(message);
    
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(
                {
                  success: true,
                  commit_hash: commitResult.commit,
                  commit_message: message,
                  summary: commitResult.summary,
                },
                null,
                2
              ),
            },
          ],
        };
      } catch (error) {
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(
                { error: `Failed to create commit: ${error.message}` },
                null,
                2
              ),
            },
          ],
          isError: true,
        };
      }
    }
  • JSON schema definition for the git_commit tool input parameters (repo_path and message).
      name: "git_commit",
      description: "Create a commit with the specified message.",
      inputSchema: {
        type: "object",
        properties: {
          repo_path: {
            type: "string",
            description: "The path to the local Git repository",
          },
          message: {
            type: "string",
            description: "The commit message",
          },
        },
        required: ["repo_path", "message"],
      },
    },
  • src/server.js:907-907 (registration)
    Maps the tool name 'git_commit' to its handler function handleGitCommit in the central handlersMap.
    git_commit: handleGitCommit,
  • Re-exports the handleGitCommit handler from commit-operations.js for use in server.js.
    handleGitCommit,
  • Imports the handleGitCommit function from the commit-operations module.
      handleGitCommitHistory,
      handleGitCommitsDetails,
      handleGitCommit,
      handleGitTrack,
    } from "./commit-operations.js";
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 states the tool creates a commit but fails to mention critical behaviors: whether it requires staged changes, if it's a destructive operation (e.g., overwriting history), authentication needs, or error conditions (e.g., empty commit). This is a significant gap for a mutation tool with zero annotation coverage.

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, direct sentence that efficiently conveys the core action without unnecessary words. It is front-loaded with the main purpose ('Create a commit'), making it easy to parse. Every part of the sentence earns its place by specifying the required input.

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 of a Git commit operation (a mutation with potential side effects), no annotations, and no output schema, the description is incomplete. It lacks information on prerequisites (e.g., staged changes), behavioral details (e.g., error handling), and return values, leaving the agent under-informed for safe and effective use.

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?

The input schema has 100% description coverage, with clear documentation for both parameters (repo_path and message). The description adds minimal value beyond the schema by implying the message is used for the commit, but it doesn't explain parameter interactions (e.g., how repo_path affects the commit location) or provide examples. This meets the baseline for high schema coverage.

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 ('Create a commit') and the required input ('with the specified message'), making the purpose immediately understandable. It distinguishes this from sibling tools like git_commit_history or git_commits_details, which retrieve commit information rather than creating one. However, it doesn't explicitly mention the repo_path parameter, which slightly limits specificity.

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. For example, it doesn't clarify prerequisites (e.g., staged changes must exist), when to use git_commit versus git_commit_history for viewing commits, or how it relates to tools like git_push for sharing commits. This leaves the agent without context for appropriate tool selection.

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/bsreeram08/git-commands-mcp'

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