git-mcp-server: Commit staged changes
git_commitCommit staged index content to a Git repository with branch and head validation, ensuring idempotent and hook-checked commits.
Instructions
Operation: Commit the exact index owned by one stage_id with native hooks and signing disabled. Returns: request_id, repository_id, commit and tree object IDs, hook_changed_paths, and signing policy; a rejected pre-commit or commit-msg hook returns HOOK_FAILED with only its allowlisted hook kind. Defaults: all inputs are required, native hooks run, and signing stays disabled. Excludes: raw hook output or exit status, amend, arbitrary index content, implicit staging, push, and hook bypass.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"repository": "<repository>",
"request_id": "<request_id>",
"expected_branch": "<expected_branch>",
"expected_head": "<expected_head>",
"stage_id": "<stage_id>",
"message": "<message>"
},
"name": "git_commit"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| message | Yes | Commit message passed only on standard input; it must contain 1 through 100000 characters. | |
| stage_id | Yes | Owned normal-stage session ID whose exact index content will be committed. | |
| repository | Yes | Absolute path to the exact target Git worktree for this mutation. | |
| request_id | Yes | Client-generated UUID that makes this mutation durable and idempotent for exact replay. | |
| expected_head | Yes | Exact current local HEAD object ID expected before mutation; mismatch rejects without Git mutation. | |
| expected_branch | Yes | Exact current local branch name expected before mutation; mismatch rejects without Git mutation. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | No | ||
| error | No | ||
| status | Yes | ||
| warnings | Yes | ||
| operation | Yes | ||
| request_id | No | ||
| repository_id | No | ||
| observed_after | No | ||
| observed_before | No |