Skip to main content
Glama

push_files

Destructive

Commit multiple file changes atomically in a single commit. Use to create, update, delete, or move files together, with optional base64 encoding for binary content.

Instructions

Push multiple files in a single commit. Use this to commit several file changes atomically; use create_or_update_file when only one path is involved. Each file defaults to action create; optional per-file action (create/update/delete/move) and encoding (text/base64) are additive. GITLAB_PERMISSION_MODE=modify rejects delete and move. The operation writes repository history on the selected branch, requires repository write permission, and returns the commit result or a validation, conflict, or protected-branch error.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filesYesArray of files to push. Each entry defaults to action 'create'. Per-file fields: action (create/update/delete/move), encoding (text/base64; omitted uses GITLAB_REPO_FILE_ENCODING), previous_path (required for move). Content is required for create and update; omit content for delete, or for a move that should keep the original file. GITLAB_PERMISSION_MODE=modify rejects delete and move.
branchYesBranch to push to
jmespathNoOptional JMESPath expression filtering the JSON result before return.
project_idYesProject ID or complete URL-encoded path to project
commit_messageYesCommit message

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv2.1.66
    • addedInput schema / properties / jmespath
      Added value: +{
      +  "description": "Optional JMESPath expression filtering the JSON result before return.",
      +  "type": "string"
      +}
  2. Changed2 schema fields changedv2.1.62
    • removedInput schema / properties / files / items / additionalProperties
      Removed value: -false
    • changedInput schema / required
      Previous value: -[
      -  "branch",
      -  "files",
      -  "commit_message",
      -  "project_id"
      -]New value: +[
      +  "project_id",
      +  "branch",
      +  "files",
      +  "commit_message"
      +]
  3. Changed7 schema fields changedv2.1.52
    • changedInput schema / properties / files / description
      Previous value: -"Array of files to push"New value: +"Array of files to push. Each entry defaults to action 'create'. Per-file fields: action (create/update/delete/move), encoding (text/base64; omitted uses GITLAB_REPO_FILE_ENCODING), previous_path (required for move). Content is required for create and update; omit content for delete, or for a move that should keep the original file. GITLAB_PERMISSION_MODE=modify rejects delete and move."
    • addedInput schema / properties / files / items / properties / action
      Added value: +{
      +  "description": "Commit action for this file. Defaults to 'create'.",
      +  "enum": [
      +    "create",
      +    "update",
      +    "delete",
      +    "move"
      +  ],
      +  "type": "string"
      +}
    • changedInput schema / properties / files / items / properties / content / description
      Previous value: -"Content of the file"New value: +"File content. Required for create and update. Omit for delete, or for a move that should keep the original content. Base64-encoded when encoding is 'base64'."
    • addedInput schema / properties / files / items / properties / encoding
      Added value: +{
      +  "description": "Use 'base64' for binary files (content must already be base64-encoded). When omitted, GITLAB_REPO_FILE_ENCODING applies.",
      +  "enum": [
      +    "text",
      +    "base64"
      +  ],
      +  "type": "string"
      +}
    • changedInput schema / properties / files / items / properties / file_path / description
      Previous value: -"Path where to create the file"New value: +"Path of the file in the repo"
    • addedInput schema / properties / files / items / properties / previous_path
      Added value: +{
      +  "description": "Previous path of the file. Required when action is 'move'.",
      +  "type": "string"
      +}
    • changedInput schema / properties / files / items / required
      Previous value: -[
      -  "file_path",
      -  "content"
      -]New value: +[
      +  "file_path"
      +]
  4. Addedv2.1.45
  5. Removedv2.1.43
  6. Addedv2.1.18
  7. Removedv2.1.14
  8. Addedv2.1.11
  9. Removedv2.1.10
  10. Changed2 schema fields changedv2.1.9
    • removedInput schema / additionalProperties
      Removed value: -false
    • changedInput schema / required
      Previous value: -[
      -  "branch",
      -  "files",
      -  "commit_message"
      -]New value: +[
      +  "branch",
      +  "files",
      +  "commit_message",
      +  "project_id"
      +]
  11. First observedv1.0.0

TDQS

A4.9/5.0
Behavior5/5

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

Annotations already flag destructiveHint, but the description adds concrete behavioral context: it writes repository history on the selected branch, requires repository write permission, and reports commit results or validation/conflict/protected-branch errors. It also discloses that GITLAB_PERMISSION_MODE=modify rejects delete and move, which is useful and non-obvious.

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?

Five compact sentences front-load the purpose and alternative, then cover defaults, restrictions, and behavior. Every sentence earns its place, with no filler or redundant restatement.

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 a complex multi-file mutation with no output schema, the description covers the core invocation context: atomic commit behavior, write permission, branch-history side effects, error classes, and permission-mode restrictions. This is enough for an agent to select and call the tool 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 100%, so the field-level details are already well documented. The description adds valuable aggregate semantics: each file defaults to action 'create', action and encoding are per-file and additive, and the permission-mode constraint on delete/move. This goes beyond simply restating 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: 'Push multiple files in a single commit.' It explicitly distinguishes itself from create_or_update_file, which is for single-path updates. An agent can immediately tell what this tool does and how it differs from a likely sibling.

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 explicit when-to-use guidance: use push_files for several atomic file changes, and use create_or_update_file when only one path is involved. This direct alternative-routing leaves no ambiguity about selection.

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

Deploy Server

Other Tools