Skip to main content
Glama

update_file

Update an existing file in a GitLab repository with optimistic concurrency control. Uses a dry-run preview by default to prevent unintended changes.

Instructions

Update an existing file in a repository. Supports optimistic concurrency via last_commit_id. dry_run=true by default.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_idYesProject ID
file_pathYesFile path in repository
branchYesBranch to commit to
contentYesNew file content
commit_messageYesCommit message
encodingNoContent encoding. Default: text.
last_commit_idNoExpected last commit ID on the file. If set and stale, GitLab returns 400 to prevent overwriting concurrent changes.
dry_runNoDry run mode (default: true). When true, returns a preview of the action without executing it. Set to false only after user confirmation.
Behavior4/5

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

Annotations indicate readOnlyHint: false, aligning with the write operation. Description adds safety context (dry_run) and concurrency details, enhancing transparency beyond annotations.

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?

Two concise sentences covering purpose, concurrency, and dry_run default. No extraneous information.

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

Completeness4/5

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

With 8 parameters and no output schema, description covers critical behavioral aspects (dry_run, concurrency). Lacks details on return values but suffices for tool usage guidance.

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

Parameters5/5

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

Description adds significant value beyond the schema, explaining the role of last_commit_id for optimistic concurrency and reiterating the dry_run default behavior. Schema coverage is 100%, so baseline is 3, but description elevates to 5.

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?

Description clearly states 'Update an existing file in a repository', which is specific verb+resource. It distinguishes from sibling tools like create_file and delete_file.

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

Usage Guidelines4/5

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

Description provides guidance on dry_run defaulting to true and instructs to set to false after user confirmation. It also mentions optimistic concurrency via last_commit_id. However, it does not explicitly contrast with alternative tools for file operations.

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/wanadev/gitlab-mcp'

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