Skip to main content
Glama

Update File Tool

update_file_tool

Modify an existing file in a GitLab repository by committing new content to a specified branch with a commit message, supporting text or base64 encoding.

Instructions

Update an existing file in a GitLab 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": {
      "project_id": "<project_id>",
      "file_path": "<file_path>",
      "branch": "<branch>",
      "content": "<content>",
      "commit_message": "<commit_message>"
    },
    "name": "update_file_tool"
  }
}

Input Schema

NameRequiredDescriptionDefault
branchYesBranch to commit to
contentYesNew file content
encodingNoContent encoding - "text" or "base64" (default: text)text
file_pathYesPath to the file
project_idYesProject ID or path
commit_messageYesCommit message

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.4.1

TDQS

C2.8/5.0
Behavior2/5

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

With no annotations provided, the description carries the full burden and falls well short. It never states that the operation creates a commit on the given branch, whether it fails when the file does not exist, how concurrent edits/conflicts are handled, or what permissions are required — all critical for a destructive write against a repository.

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

Conciseness3/5

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

A single short sentence with no waste, but it is under-specified rather than appropriately concise — the brevity comes at the cost of the behavioral detail this mutation tool needs. Front-loading is fine given the length.

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

Completeness2/5

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

An output schema exists, so return values need not be explained, but for a repository-mutating tool with no annotations the description should still explain commit creation, branch existence requirements, and failure modes. It covers none of these, leaving an agent to guess at write semantics.

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% across all 6 parameters, so the schema already documents project_id, file_path, branch, content, commit_message and the text/base64 encoding option. The description adds nothing beyond that, so the baseline 3 applies.

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?

States a specific verb and resource ("Update an existing file in a GitLab repository"), which is unambiguous and distinguishable from get_file_tool and create_file_tool by name alone. However, it does not explicitly call out the boundary against create_file_tool (new vs existing file) or delete/create_branch, leaving the differentiation implicit.

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 versus create_file_tool (for a new file) or when to prefer commit-based workflows. No prerequisites are stated — nothing says the file and target branch must already exist, nor what to do if the file is absent.

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