Skip to main content
Glama

GitHub commit files

github_commit_files
Destructive

Commit one or more files to a GitHub repository. Prefer the exact owner from github_list_repositories; 'repo' also accepts the combined 'owner/name' form. Creates or updates files in a single atomic commit. Use this to add Dockerfiles, CI workflows, configuration files, etc. Maximum 20 files and 500KB total content per commit.

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": {
      "owner": "<owner>",
      "repo": "<repo>",
      "files": "<files>",
      "commit_message": "<commit_message>"
    },
    "name": "github_commit_files"
  }
}

Input Schema

NameRequiredDescriptionDefault
repoYesRepository name. Also accepts the combined 'owner/name' form.
filesYesFiles to create or update. Each entry has a 'path' and 'content'.
ownerYesRepository owner (e.g. 'octocat'). Prefer the exact owner from a prior github_list_repositories call. May be embedded in 'repo' as 'owner/name'.
branchNoBranch to commit to. Defaults to the repository's default branch.
merge_parentNoMerge another branch of this repository into 'branch': its name, never a commit id. The commit becomes a true merge commit whose parents are 'branch' and merge_parent, carrying every change merge_parent made since the two diverged with its file modes. 'files' must then resolve every file both sides changed since they diverged, with the complete merged content or as a deletion; the call is refused, naming them, while any is unresolved. Use it to resolve a pull request that conflicts with its base: merge_parent is the base branch and 'branch' the pull request's branch, never the default branch.
commit_messageYesGit commit message describing the changes.
staged_change_idNoOptional: the staged_change_id a workspace_bump_dependency call answered. The files the package manager regenerated (the lockfile and its manifest) are added to this commit exactly as it wrote them; pass any other files you change in 'files' (an empty list when there are none). Never write a lockfile yourself.
confirm_large_deletionsNoPaths from 'files' whose new content is intentionally much shorter than the file it replaces. A commit that would replace an existing file with less than half of its content is refused unless that path is listed here. Leave this out unless a refusal named the path and removing that much is the change you intend.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / staged_change_id
      Added value: +{
      +  "description": "Optional: the staged_change_id a workspace_bump_dependency call answered. The files the package manager regenerated (the lockfile and its manifest) are added to this commit exactly as it wrote them; pass any other files you change in 'files' (an empty list when there are none). Never write a lockfile yourself.",
      +  "type": "string"
      +}
  2. Changed3 schema fields changed
    • addedInput schema / properties / files / items / properties / delete
      Added value: +{
      +  "description": "With merge_parent only: true resolves a file both sides changed by removing it (a file one side deleted or renamed away). Leave 'content' out. Counts as a large deletion (confirm_large_deletions).",
      +  "type": "boolean"
      +}
    • changedInput schema / properties / files / items / required
      Previous value: -[
      -  "path",
      -  "content"
      -]New value: +[
      +  "path"
      +]
    • addedInput schema / properties / merge_parent
      Added value: +{
      +  "description": "Merge another branch of this repository into 'branch': its name, never a commit id. The commit becomes a true merge commit whose parents are 'branch' and merge_parent, carrying every change merge_parent made since the two diverged with its file modes. 'files' must then resolve every file both sides changed since they diverged, with the complete merged content or as a deletion; the call is refused, naming them, while any is unresolved. Use it to resolve a pull request that conflicts with its base: merge_parent is the base branch and 'branch' the pull request's branch, never the default branch.",
      +  "type": "string"
      +}
  3. Changed2 schema fields changed
    • addedInput schema / properties / confirm_large_deletions
      Added value: +{
      +  "description": "Paths from 'files' whose new content is intentionally much shorter than the file it replaces. A commit that would replace an existing file with less than half of its content is refused unless that path is listed here. Leave this out unless a refusal named the path and removing that much is the change you intend.",
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
    • changedInput schema / properties / files / items / properties / content / description
      Previous value: -"File content as a string."New value: +"The COMPLETE new content of the file. The commit replaces the whole file with this string; it is not a patch, so anything left out is deleted."
  4. First observed

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=false, idempotentHint=false and destructiveHint=true, so the safety profile is covered. The description adds non-annotation behavior that matters for correct invocation: the commit is atomic and is capped at 20 files and 500KB of total content, both of which can cause a call to be refused. It does not describe the response, but no output schema exists either.

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?

Four short sentences with the core action and the “repo accepts owner/name” caveat front-loaded, followed by use cases and hard limits. Little waste overall, though the owner/repo sentence partially repeats what the schema already says.

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

Completeness4/5

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

For an 8-parameter destructive mutation with a fully documented schema, the description supplies the two facts not available structurally: atomic commit semantics and the 20-file/500KB ceiling. Merge and deletion-refusal behavior lives in the schema, so nothing critical is missing, though the commit result/return behavior is unaddressed.

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

Parameters3/5

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

Schema description coverage is 100%, including long-form explanations of merge_parent, staged_change_id and confirm_large_deletions, so the schema carries the semantic burden. The description's owner/repo guidance largely restates schema text (“Prefer the exact owner from a prior github_list_repositories call”), so the baseline of 3 is appropriate.

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

Purpose4/5

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

Names a specific verb and resource (“Commit one or more files to a GitHub repository”) and clarifies that files are created or updated in a single atomic commit. It does not explicitly distinguish itself from near neighbours such as github_create_pull_request or github_read_file, so the sibling differentiation is only implicit.

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 concrete use cases (Dockerfiles, CI workflows, configuration files) and points to github_list_repositories for obtaining the owner, which is real routing guidance. It stops short of stating when *not* to use it — e.g. proposing changes via a pull request instead of committing directly.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.