Skip to main content
Glama
Akxan
by Akxan

Commit file changes to GitHub

github_commit_files
Destructive

Commit multiple file changes to a GitHub branch in one atomic operation, supporting content updates, in-place edits, deletions, dry-run previews, and optional branch creation.

Instructions

One atomic commit that adds, updates, edits or deletes several files on a branch (Git Data API); the site's CI/CD then deploys. Per file give exactly one of: content (full replacement; set encoding=base64 for binary), edits (in-place find/replace against the branch's current file, right for large files such as a 300 KB content bundle), or delete. createBranch=true creates the branch from the default branch first. dryRun previews sizes, changed-line counts and whether each edit matches exactly once, without committing.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
repoYesRepository as 'owner/name', e.g. 'octocat/my-site'.
filesYes
branchYesBranch to commit to, e.g. 'main'.
dryRunNoPreview only: report each file's action, sizes and changed-line counts (edits are validated) without committing.
messageYesCommit message in the repository's conventions.
createBranchNoIf true, create `branch` from the repo's default branch when it does not exist yet.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv0.8.0
    • changedInput schema / properties / dryRun / description
      Previous value: -"Preview only: compare each file with the branch's current content (size and changed-line counts) without committing."New value: +"Preview only: report each file's action, sizes and changed-line counts (edits are validated) without committing."
    • changedInput schema / properties / files / items / properties / content / description
      Previous value: -"Full new file content (UTF-8). Omit when delete=true."New value: +"Full new file content. UTF-8 text, or base64 when encoding=base64."
    • addedInput schema / properties / files / items / properties / edits
      Added value: +{
      +  "description": "Applied in order to the file's current content on the branch; the file must exist and be text.",
      +  "items": {
      +    "properties": {
      +      "all": {
      +        "default": false,
      +        "description": "Replace every occurrence instead of requiring a single match.",
      +        "type": "boolean"
      +      },
      +      "find": {
      +        "description": "Exact text to replace; must occur once (include context to disambiguate).",
      +        "minLength": 1,
      +        "type": "string"
      +      },
      +      "replace": {
      +        "description": "Replacement text (may be empty, may span lines).",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "find",
      +      "replace"
      +    ],
      +    "type": "object"
      +  },
      +  "maxItems": 50,
      +  "minItems": 1,
      +  "type": "array"
      +}
    • addedInput schema / properties / files / items / properties / encoding
      Added value: +{
      +  "default": "utf8",
      +  "description": "base64 for binary files (images, fonts).",
      +  "enum": [
      +    "utf8",
      +    "base64"
      +  ],
      +  "type": "string"
      +}
  2. Changed4 schema fields changedv0.5.1
    • removedInput schema / additionalProperties
      Removed value: -false
    • addedInput schema / properties / dryRun
      Added value: +{
      +  "default": false,
      +  "description": "Preview only: compare each file with the branch's current content (size and changed-line counts) without committing.",
      +  "type": "boolean"
      +}
    • removedInput schema / properties / files / items / additionalProperties
      Removed value: -false
    • changedInput schema / properties / message / description
      Previous value: -"Commit message. Follow the repository's conventions (language, style)."New value: +"Commit message in the repository's conventions."
  3. First observedv0.3.0

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already flag destructive and non-idempotent, and the description adds meaningful context beyond them: commits are atomic, edits apply in order against the branch's current content and require an exact single match unless all=true, the file must exist and be text, and dryRun validates matches and reports sizes/changed-line counts without committing.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the core purpose and otherwise dense with no filler; two sentences carry a lot of required detail. The sentences run long, but every clause earns its place by describing a distinct per-file mode or flag.

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?

For a destructive, multi-mode mutation tool with no output schema, the description supplies the mode selection rules, atomicity, exact-match semantics, branching behavior, and dry-run validation an agent needs to invoke it correctly.

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 83%, so the baseline is 3, but the description adds real meaning: encoding=base64 is for binary files, edits is find/replace with single-match requirement, createBranch seeds from the default branch, and dryRun previews per-file action, sizes, and changed-line counts. It leaves a few details (e.g., maxItems limits, required path) to the schema.

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?

States a specific verb and resource ('atomic commit that adds, updates, edits or deletes several files on a branch') and names the underlying mechanism (Git Data API) plus the downstream effect (CI/CD deploys). This distinguishes it from siblings like github_get_file, github_commit_image, and github_commit_attachment.

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

Usage Guidelines4/5

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

Gives explicit per-mode routing: 'per file give exactly one of content ... edits ... or delete', and clarifies edits is 'right for large files such as a 300 KB content bundle'. It also explains createBranch and dryRun usage. It stops short of stating when to prefer this tool over the specialized siblings (image/attachment committers).

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