Skip to main content
Glama

Create Or Update File

gitlab_create_or_update_file

Create or update one file in a GitLab repository by specifying its path, branch, content, and commit message.

Instructions

Create or update one file in repository.

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": {
      "file_path": "<file_path>",
      "branch": "<branch>",
      "content": "<content>",
      "commit_message": "<commit_message>"
    },
    "name": "gitlab_create_or_update_file"
  }
}

Input Schema

NameRequiredDescriptionDefault
branchYes
contentYes
encodingNo
commit_idNo
file_pathYes
project_idNo
author_nameNo
author_emailNo
start_branchNo
previous_pathNo
commit_messageYes
last_commit_idNo
execute_filemodeNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed16 schema fields changedv1.7.0
    • removedInput schema / properties / author_email / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedInput schema / properties / author_email / type
      Added value: +[
      +  "string",
      +  "null"
      +]
    • removedInput schema / properties / author_name / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedInput schema / properties / author_name / type
      Added value: +[
      +  "string",
      +  "null"
      +]
    • removedInput schema / properties / commit_id / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedInput schema / properties / commit_id / type
      Added value: +[
      +  "string",
      +  "null"
      +]
    • removedInput schema / properties / encoding / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedInput schema / properties / encoding / type
      Added value: +[
      +  "string",
      +  "null"
      +]
    • removedInput schema / properties / execute_filemode / anyOf
      Removed value: -[
      -  {
      -    "type": "boolean"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedInput schema / properties / execute_filemode / type
      Added value: +[
      +  "boolean",
      +  "null"
      +]
    • removedInput schema / properties / last_commit_id / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedInput schema / properties / last_commit_id / type
      Added value: +[
      +  "string",
      +  "null"
      +]
    • removedInput schema / properties / previous_path / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedInput schema / properties / previous_path / type
      Added value: +[
      +  "string",
      +  "null"
      +]
    • removedInput schema / properties / start_branch / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedInput schema / properties / start_branch / type
      Added value: +[
      +  "string",
      +  "null"
      +]
  2. First observedv1.6.1

TDQS

C2/5.0
Behavior2/5

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

Annotations already declare readOnlyHint=false, destructiveHint=false, idempotentHint=false and openWorldHint=true, so safety basics are covered. The description adds nothing on top: it never says that each call produces a commit, that updating overwrites existing file content, how the optional commit_id/last_commit_id conflict controls behave, or what happens when the branch does not exist — a serious gap for a 13-parameter mutation tool.

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

Conciseness2/5

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

The single sentence is front-loaded and contains no filler, but it is drastically undersized for a tool with 13 parameters and create/update branching. Brevity here is under-specification rather than concision.

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

Completeness1/5

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

With no output schema, 0% parameter documentation and no behavioral detail, the definition does not give an agent enough to invoke this correctly — particularly around conflict handling (last_commit_id), file mode, and path renames. A mutation tool of this complexity needs substantially more.

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

Parameters1/5

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

Schema description coverage is 0% across 13 parameters and the description names none of them, leaving encoding, content, commit_id, last_commit_id, previous_path (path moves), start_branch, execute_filemode and author fields entirely unexplained. The agent has to guess at the semantics of every non-obvious field from its name alone.

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

Purpose3/5

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

The description names a specific verb pair (create or update) and resource (one file in a repository), which is clearer than the bare title. However, it says nothing about the operation creating a commit or how the create-vs-update branch resolves, so it is only marginally more informative than the name itself.

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

Usage Guidelines2/5

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

There is no guidance on when to use this instead of gitlab_get_file_contents for reads or gitlab_create_branch for branch setup; the reader must infer from the name. No prerequisites (project_id, branch existence, permissions) are mentioned.

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