Skip to main content
Glama

create_or_update_file

Create or modify files in GitLab projects by specifying content, path, and commit details to manage repository files through API operations.

Instructions

Create or update a single file in a GitLab project

Input Schema

NameRequiredDescriptionDefault
project_idYesProject ID or complete URL-encoded path to project
file_pathYesPath where to create/update the file
contentYesContent of the file
commit_messageYesCommit message
branchYesBranch to create/update the file in
previous_pathNoPath of the file to move/rename
last_commit_idNoLast known file commit ID
commit_idNoCurrent file commit ID (for update operations)

Input Schema (JSON Schema)

{ "properties": { "branch": { "description": "Branch to create/update the file in", "type": "string" }, "commit_id": { "description": "Current file commit ID (for update operations)", "type": "string" }, "commit_message": { "description": "Commit message", "type": "string" }, "content": { "description": "Content of the file", "type": "string" }, "file_path": { "description": "Path where to create/update the file", "type": "string" }, "last_commit_id": { "description": "Last known file commit ID", "type": "string" }, "previous_path": { "description": "Path of the file to move/rename", "type": "string" }, "project_id": { "description": "Project ID or complete URL-encoded path to project", "type": "string" } }, "required": [ "project_id", "file_path", "content", "commit_message", "branch" ], "type": "object" }

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

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