Skip to main content
Glama

create_or_update_file

Create or update a single file in a GitLab repository and commit it to a chosen branch, with optional rename or move support.

Instructions

Create or update a single file in a GitLab repository

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
branchYesBranch to commit to (e.g. 'main' or 'feature/auth')
contentYesFull content of the file to write
file_pathYesFile path to create or update (e.g. 'docs/roadmap.md')
project_idYesProject numeric ID (e.g. 31) or namespace path (e.g. 'group/project-name'). URL-encoding is handled automatically.
previous_pathNoIf renaming or moving a file, specify the old path
commit_messageYesClear Git commit message describing the change

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.0.0

TDQS

C2.9/5.0
Behavior2/5

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

With no annotations, the description carries the entire burden of behavioral disclosure, and it says nothing about authentication requirements, conflict handling (e.g., stale-commit detection on update), whether the branch is auto-created, or what happens when the file already exists. The implicit upsert semantics are the only behavioral signal, which is thin for a 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.

Conciseness4/5

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

A single front-loaded sentence with no filler or redundancy. It is arguably under-specified rather than concise, but there is no wasted text to trim.

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?

For a mutating repository write with no annotations and no output schema, the description omits essential context: that it returns a commit reference, whether branches must pre-exist, and how conflicts are surfaced. An agent could invoke it, but not confidently predict its effects or failure modes.

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% with per-parameter examples (branch formats, project ID forms, file paths, previous_path for renames), so the schema already does the explanatory work. The description adds nothing beyond that, which matches the baseline of 3 when the schema is complete.

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?

The description gives a specific verb pair (create or update) and resource (a single file in a GitLab repository), making the operation immediately identifiable. However, it offers no differentiation from the sibling push_files, which also writes files, so an agent cannot tell the two apart from description text alone.

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 choose this over push_files or create_branch, nor any mention of prerequisites such as the branch existing or the project being writable. The 'create or update' phrasing hints at upsert behavior but stops short of stating it as a usage rule.

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