Skip to main content
Glama

Commit files to repository

commit_repo_files
Destructive

WRITE files to the repository in one commit: create, overwrite entirely or delete. ⚠️ Writes to the branch on behalf of the caller and immediately: the commit appears in shared history, the push starts a CI run, and it can be undone only by a reverting commit. createNewBranch=false WRITES TO AN EXISTING BRANCH: name main and the change goes straight into main, bypassing review. BRANCH PROTECTION DOES NOT APPLY HERE: this endpoint places the commit bypassing the check that guards a regular git push, so "the branch is protected" will not stop you; there is also no tool to read the protection rules, so ask a person. Safe order: createNewBranch=true + sourceBranch, then create_code_review. Content is TEXT; binary files cannot be uploaded this way

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": {
      "projectKey": "<projectKey>",
      "repoName": "<repoName>",
      "branch": "<branch>",
      "message": "<message>",
      "files": "<files>"
    },
    "name": "commit_repo_files"
  }
}

Input Schema

NameRequiredDescriptionDefault
filesYesFiles of one commit. DELETE is possible only when the list has ONE file: the server's batch write cannot delete
branchYesWhere the commit goes. createNewBranch=true: the name of a NEW branch (the server creates it); otherwise the name of an EXISTING branch to write to. A slash is fine (feature/x)
messageYesCommit message
repoNameYesRepository name (list_repositories)
projectKeyYesProject key, e.g. C4SPACE. Also accepts org/KEY (e.g. code4space/C4SPACE), as in a new-form web address; org (case-insensitive) must be your organization's slug or a former slug of it, otherwise the call is refused
sourceBranchNoBranch to fork the new one from. REQUIRED when createNewBranch=true
createNewBranchNotrue: create a new branch named branch, forking it from sourceBranch. false/omitted: write to the existing branch named branch

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.4/5.0
Behavior4/5

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

Goes well beyond the annotations: immediate shared-history commit, CI triggered by the push, undo only via a reverting commit, branch protection bypassed, text-only content, and DELETE limited to a single-file list. The only shortfall is that the response/return value (e.g. commit identifier) is never described. It also correctly reinforces destructiveHint=true rather than contradicting it.

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-loads the operation set, then escalates to the destructive warnings, with the recommended safe path last; wording is dense but each sentence carries distinct information. Heavy capitalization and repeated emphasis make it slightly louder than necessary.

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

Completeness3/5

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

Covers the hard parts of a destructive write tool: irreversibility, protection bypass, text-only limitation, and branch-creation sequencing. With no output schema, an agent still does not know what a successful call returns or what errors look like beyond the refused projectKey case.

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 schema already carries the parameter documentation; the description still adds risk semantics the schema only states neutrally, notably that createNewBranch=false targets an existing branch such as main with no review, and that file content is plain text with no binary or append path.

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 plus the full set of operations ('WRITE files to the repository in one commit: create, overwrite entirely or delete'), which clearly separates it from read-only siblings like read_repo_file, list_repo_files and get_commit_diff.

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?

Gives an explicit safe order ('createNewBranch=true + sourceBranch, then create_code_review'), names the sibling to use next, and explains the consequences of the alternative setting (createNewBranch=false goes straight into main bypassing review). It also tells the agent when to stop and ask a person, since no tool exists to read protection rules.

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.