Skip to main content
Glama
martinsky999

MCP Git Server

by martinsky999

git_commit

Records changes to a Git repository by creating a commit with a descriptive message, enabling version control and tracking of modifications.

Instructions

Records changes to the repository

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
repo_pathYes
messageYes

Implementation Reference

  • The handler function implementing the git_commit tool logic using GitPython to commit staged changes.
    def git_commit(repo: git.Repo, message: str) -> str:
        commit = repo.index.commit(message)
        return f"Changes committed successfully with hash {commit.hexsha}"
  • Pydantic model for input schema of git_commit tool.
    class GitCommit(BaseModel):
        repo_path: str
        message: str
  • Tool registration in list_tools() defining name, description, and schema for git_commit.
    Tool(
        name=GitTools.COMMIT,
        description="Records changes to the repository",
        inputSchema=GitCommit.schema(),
    ),
  • Enum constant defining the tool name 'git_commit'.
    COMMIT = "git_commit"

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

C2.4/5.0
Behavior2/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 of behavioral disclosure. 'Records changes' implies a write operation that creates a commit, but it doesn't disclose key traits: whether it requires staged changes, what happens on failure (e.g., if no changes are staged), if it's destructive (it creates immutable commits, but this isn't stated), or authentication needs. The description is minimal and misses critical behavioral context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with no wasted words. It's front-loaded and clear in its brevity, though it could be more informative. The structure is appropriate for its length, but it lacks depth.

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 write action with specific prerequisites), no annotations, no output schema, and 0% schema description coverage, the description is incomplete. It doesn't explain the commit process, return values, or error conditions. For a tool with 2 parameters and behavioral nuances, this is inadequate.

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

Parameters2/5

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

Schema description coverage is 0%, so the schema provides no parameter descriptions. The tool description adds no information about the parameters (repo_path and message) beyond what the schema titles imply. It doesn't explain what repo_path should be (e.g., path to git repository) or what message should contain (e.g., commit message). This fails to compensate for the low coverage.

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

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Records changes to the repository' states a purpose but is vague. It uses the verb 'records' which implies committing changes, but doesn't specify what kind of changes (e.g., staged changes) or distinguish it from siblings like git_add (which stages changes) or git_log (which shows commit history). The description is better than a tautology but lacks 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. It doesn't mention prerequisites (e.g., needing to stage changes with git_add first), exclusions, or context for choosing it over other git tools like git_commit_amend. Without such guidance, users might misuse it.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.