Skip to main content
Glama

Update repository file

update_file

Replace a file in a GitLab repository and commit the change. Provide last_commit_id to prevent overwriting concurrent edits.

Instructions

Replace a repository file and commit the change. Supply last_commit_id to prevent overwriting a concurrent edit.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
branchYes
contentYes
projectYesGitLab project ID or full path such as group/project.
encodingNotext
author_nameNo
author_emailNo
start_branchNo
commit_messageYes
last_commit_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYesGitLab response normalized for model use.
Behavior4/5

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

Annotations already indicate readOnlyHint=false, destructiveHint=false, idempotentHint=false. The description adds meaningful behavioral context: that the tool commits the change and that last_commit_id provides optimistic locking against concurrent edits. This goes beyond the annotations, though it doesn't cover failure modes or other side effects.

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?

The description is two sentences, front-loaded with the primary action, and contains no filler. Every clause adds value, from the core operation to the concurrency warning.

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?

This is a complex tool with 10 parameters, an output schema, and many sibling file tools. The description is too sparse: it doesn't explain branch vs. start_branch, encoding choices, author fields, or how this differs from create_file/delete_file beyond 'replace.' Given the tool's complexity, more guidance is needed.

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

Parameters2/5

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

Schema description coverage is only 10% (only 'project' has a description), yet the description only elaborates on last_commit_id—and that briefly. The other nine parameters, including path, branch, content, encoding, author_name, and commit_message, have no added explanation, leaving agents to rely on names alone. This is insufficient for a 10-parameter tool.

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 tool's function: 'Replace a repository file and commit the change.' This distinguishes it from sibling tools like create_file and delete_file by emphasizing replacement of an existing file, and it specifically names the commit action.

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?

The description provides clear context—use this to replace an existing repository file and commit. It also gives a concrete usage instruction: supply last_commit_id to prevent overwriting concurrent edits. However, it does not explicitly mention alternatives or when not to use this tool, though the context is sufficient.

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

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