Skip to main content
Glama
saitolume

git-mcp-server

by saitolume

git-mcp-server: Commit staged changes

git_commit

Commit 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.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
messageYesCommit message passed only on standard input; it must contain 1 through 100000 characters.
stage_idYesOwned normal-stage session ID whose exact index content will be committed.
repositoryYesAbsolute path to the exact target Git worktree for this mutation.
request_idYesClient-generated UUID that makes this mutation durable and idempotent for exact replay.
expected_headYesExact current local HEAD object ID expected before mutation; mismatch rejects without Git mutation.
expected_branchYesExact current local branch name expected before mutation; mismatch rejects without Git mutation.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataNo
errorNo
statusYes
warningsYes
operationYes
request_idNo
repository_idNo
observed_afterNo
observed_beforeNo
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations indicate a write operation (readOnlyHint=false) and lack idempotency (idempotentHint=false). The description adds crucial detail: native hooks run, rejected hooks return HOOK_FAILED, the commit is durable via request_id, and the return fields include hook_changed_paths and signing policy. No contradiction.

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, well-structured paragraph with front-loaded core purpose ('Commit'), followed by operation details, return info, defaults, and exclusions. Every sentence is informative without any wasted words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given six required parameters and an output schema, the description covers purpose, behavioral nuances (hook interaction, return values), exclusions, and defaults. The output schema exists to define return types, so the description need not repeat them. It fully addresses the tool's complexity.

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

Parameters5/5

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

Schema coverage is 100%, and the description adds extra context for each parameter, such as 'message passed only on standard input', 'stage_id is owned normal-stage session', and 'request_id makes mutation durable and idempotent'. This goes beyond the schema's parameter descriptions.

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

Purpose5/5

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

The description clearly states the tool commits the exact index of a given stage_id with native hooks and signing disabled. It uses a specific verb ('Commit') and resource ('index owned by one stage_id'), and distinguishes from sibling tools like git_add (staging) and git_push (pushing).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly lists defaults (all inputs required, native hooks run, signing disabled) and exclusions (no raw hook output, amend, implicit staging, push, hook bypass). This helps the agent understand when to use this tool versus alternatives like git_push.

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/saitolume/git-mcp-server'

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