Skip to main content
Glama

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"

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/martinsky999/mcp-git-py'

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