Skip to main content
Glama

Git commit

git_commit

Commit local changes by staging provided paths or using already staged files, with optional amend; no merge, rebase, or push is performed.

Instructions

Commit changes. Without paths: commit whatever is staged (paths given to it are staged first with git add). Amend is opt-in. Use when: your edits are ready to be committed locally. Avoid when: nothing should be committed (git only stages when paths are given, or you already staged). Merge/rebase and push are not performed. Output: sha, short_sha, subject, files_changed, files, amend. No staged changes gives invalid_request (pass paths or stage first).

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": {
      "message": "<message>"
    },
    "name": "git_commit"
  }
}

Input Schema

NameRequiredDescriptionDefault
amendNotrue amends HEAD instead of creating a new commit.
pathsNoOptional workspace-relative paths to stage. Omit to commit what is already staged.
reasonNoOptional why (max 400 chars), audit-logged.
messageYesCommit message (first line is the subject).
allow_emptyNotrue allows an empty commit (git commit --allow-empty).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed10 schema fields changedv4.5.0
    • removedInput schema / properties / allow_empty / anyOf
      Removed value: -[
      -  {
      -    "type": "boolean"
      -  },
      -  {
      -    "maximum": 1,
      -    "minimum": 0,
      -    "type": "integer"
      -  }
      -]
    • changedInput schema / properties / allow_empty / description
      Previous value: -"1 allows an empty commit (git commit --allow-empty)."New value: +"true allows an empty commit (git commit --allow-empty)."
    • removedInput schema / properties / allow_empty / maximum
      Removed value: -1
    • removedInput schema / properties / allow_empty / minimum
      Removed value: -0
    • changedInput schema / properties / allow_empty / type
      Previous value: -"integer"New value: +"boolean"
    • removedInput schema / properties / amend / anyOf
      Removed value: -[
      -  {
      -    "type": "boolean"
      -  },
      -  {
      -    "maximum": 1,
      -    "minimum": 0,
      -    "type": "integer"
      -  }
      -]
    • changedInput schema / properties / amend / description
      Previous value: -"1 amends HEAD instead of creating a new commit."New value: +"true amends HEAD instead of creating a new commit."
    • removedInput schema / properties / amend / maximum
      Removed value: -1
    • removedInput schema / properties / amend / minimum
      Removed value: -0
    • changedInput schema / properties / amend / type
      Previous value: -"integer"New value: +"boolean"
  2. Addedv4.0.0

TDQS

A4.9/5.0
Behavior5/5

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

Beyond the annotations, which only establish that this is a non-read-only, non-destructive write, the description discloses key behavior: paths are staged with git add first, amend is opt-in, merge/rebase/push are not performed, and no staged changes yields invalid_request. It also names the output fields, compensating for the missing output schema.

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 front-loaded with the core action, then moves through scoped rules, usage guidance, output, and failure behavior. Every sentence contributes useful information, and the structure supports quick scanning.

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?

Although there is no output schema, the description enumerates the returned fields and the primary failure mode. Combined with the staging semantics, amend opt-in behavior, and explicit exclusions, it gives an agent enough information to call the tool correctly and interpret the result.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3. The description adds meaningful behavioral context about the paths parameter: when paths are omitted, whatever is already staged is committed; when paths are supplied, they are staged first. It doesn't elaborate on allow_empty or reason beyond the schema, but the paths/no-paths distinction is operationally important.

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 states a specific action and resource: 'Commit changes.' It then clarifies the two operating modes (staged-only vs. paths staged first) and explicitly excludes merge/rebase/push. This gives an agent a precise operational picture without needing to infer behavior from the name alone.

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?

It provides explicit 'Use when' and 'Avoid when' guidance, including the important condition that nothing should be committed if staging has not occurred. It also supplies a recovery path for the no-staged-changes error: pass paths or stage first.

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