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
| Name | Required | Description | Default |
|---|---|---|---|
| repo_path | Yes | ||
| message | Yes |
Implementation Reference
- src/mcp_server_git/server.py:89-91 (handler)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}"
- src/mcp_server_git/server.py:32-34 (schema)Pydantic model for input schema of git_commit tool.class GitCommit(BaseModel): repo_path: str message: str
- src/mcp_server_git/server.py:191-195 (registration)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(), ),
- src/mcp_server_git/server.py:68-68 (registration)Enum constant defining the tool name 'git_commit'.COMMIT = "git_commit"