Skip to main content
Glama

Write file

gitlab_create_or_update_file

Create or update a file in a GitLab branch by providing content, file path, branch, and commit message.

Instructions

Creates or updates a single file in a branch.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionNoDefault: update if it exists
branchYesBranch to commit to
contentYesFull new file content
file_pathYes
project_idNoProject id or URL-encoded path, e.g. `42` or `group/subgroup/project`. Falls back to GITLAB_PROJECT_ID.
author_nameNo
author_emailNo
start_branchNoCreate `branch` from this branch first
commit_messageYes
Behavior2/5

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

Annotations provide minimal information (readOnlyHint=false, destructiveHint=false), so the description carries the burden of behavioral disclosure. It states the mutation action but omits important details such as whether existing content is overwritten, whether a commit is created, or any prerequisites like branch existence. This is insufficient for a mutation tool without annotation support.

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?

The description is a single sentence that is concise and front-loaded with the action. It avoids unnecessary verbosity, but given the tool's complexity (9 parameters), the extreme brevity leaves out essential context that could be included without bloat.

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 9-parameter mutation tool with no output schema and minimal annotations, this one-line description is incomplete. It omits critical context such as the action default, project_id fallback, start_branch behavior, and potential side effects. The description fails to provide a complete operational picture.

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?

The description adds no meaning to any of the 9 parameters. Schema coverage is only 56%, leaving parameters like author_name, author_email, and commit_message without descriptions, and the description does not compensate for this gap. It provides zero parameter-level guidance beyond what the schema already offers.

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?

The description clearly states the verb (creates/updates) and resource (single file in a branch), making it unambiguous and distinct from sibling tools like gitlab_get_file or gitlab_commit_files which handle reads or multiple files. It fully captures the tool's core function.

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

Usage Guidelines3/5

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

The phrase 'single file' implies this is for single-file operations, but no explicit guidance on when to use this vs. alternatives like gitlab_commit_files is provided. There are no exclusions or alternative recommendations, so usage context is only implied.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/amalychev/gitlab-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server