Skip to main content
Glama

MCP GitLab Server

by Vijay-Duke

gitlab_safe_preview_commit

Validate and preview GitLab commit changes without applying them. Checks affected files, permissions, file paths, and potential errors. Use to ensure accuracy and safety before committing.

Instructions

Preview commit without creating Returns: What would change, validation results Use when: Validating before actual commit Shows: Affected files, potential errors

Safety features:

  • No actual changes made

  • Validates file paths

  • Checks permissions

Related tools:

  • gitlab_create_commit: Actual commit

  • gitlab_list_repository_tree: Check files exist

Input Schema

NameRequiredDescriptionDefault
actionsYesFile operations for commit Type: array of objects Required: Yes Max items: 100 per commit Structure: { "action": "create" | "update" | "delete" | "move", "file_path": "string (required)", "content": "string (required for create/update)", "encoding": "text" | "base64" (optional, default: text)", "previous_path": "string (required for move)" } Examples: [ { "action": "create", "file_path": "src/config.json", "content": "{"debug": true}" }, { "action": "update", "file_path": "README.md", "content": "# Updated README\n\nNew content here" }, { "action": "delete", "file_path": "old-file.txt" }, { "action": "move", "file_path": "new-location/file.txt", "previous_path": "old-location/file.txt" } ] Use cases: - create: Add new files - update: Modify existing files - delete: Remove files - move: Rename or relocate files
branchYesTarget branch for commits Type: string Required: Yes Format: Existing branch name Examples: - 'main' (commit to main) - 'feature/add-login' (feature branch) - 'hotfix/security-patch' (hotfix branch) Note: Branch must exist before committing
commit_messageYesCommit message Type: string Required: Yes Format: Conventional commits recommended Structure: - First line: Summary (50-72 chars) - Blank line - Body: Detailed description - Footer: References, breaking changes Examples: 'feat: Add user authentication Implement JWT-based authentication with refresh tokens. Store tokens securely in httpOnly cookies. Closes #123'
project_idNoProject identifier (auto-detected if not provided) Type: integer OR string Format: numeric ID or 'namespace/project' Optional: Yes - auto-detects from current git repository Examples: - 12345 (numeric ID) - 'gitlab-org/gitlab' (namespace/project path) - 'my-group/my-subgroup/my-project' (nested groups) Note: If in a git repo with GitLab remote, this can be omitted

Input Schema (JSON Schema)

{ "properties": { "actions": { "description": "File operations for commit\nType: array of objects\nRequired: Yes\nMax items: 100 per commit\nStructure:\n{\n \"action\": \"create\" | \"update\" | \"delete\" | \"move\",\n \"file_path\": \"string (required)\",\n \"content\": \"string (required for create/update)\",\n \"encoding\": \"text\" | \"base64\" (optional, default: text)\",\n \"previous_path\": \"string (required for move)\"\n}\n\nExamples:\n[\n {\n \"action\": \"create\",\n \"file_path\": \"src/config.json\",\n \"content\": \"{\"debug\": true}\"\n },\n {\n \"action\": \"update\",\n \"file_path\": \"README.md\",\n \"content\": \"# Updated README\\n\\nNew content here\"\n },\n {\n \"action\": \"delete\",\n \"file_path\": \"old-file.txt\"\n },\n {\n \"action\": \"move\",\n \"file_path\": \"new-location/file.txt\",\n \"previous_path\": \"old-location/file.txt\"\n }\n]\n\nUse cases:\n- create: Add new files\n- update: Modify existing files\n- delete: Remove files\n- move: Rename or relocate files", "items": { "properties": { "action": { "enum": [ "create", "update", "delete", "move" ], "type": "string" }, "content": { "type": "string" }, "encoding": { "default": "text", "enum": [ "text", "base64" ], "type": "string" }, "file_path": { "type": "string" }, "previous_path": { "type": "string" } }, "required": [ "action", "file_path" ], "type": "object" }, "type": "array" }, "branch": { "description": "Target branch for commits\nType: string\nRequired: Yes\nFormat: Existing branch name\nExamples:\n - 'main' (commit to main)\n - 'feature/add-login' (feature branch)\n - 'hotfix/security-patch' (hotfix branch)\nNote: Branch must exist before committing", "type": "string" }, "commit_message": { "description": "Commit message\nType: string\nRequired: Yes\nFormat: Conventional commits recommended\nStructure:\n - First line: Summary (50-72 chars)\n - Blank line\n - Body: Detailed description\n - Footer: References, breaking changes\nExamples:\n 'feat: Add user authentication\n\n Implement JWT-based authentication with refresh tokens.\n Store tokens securely in httpOnly cookies.\n\n Closes #123'", "type": "string" }, "project_id": { "description": "Project identifier (auto-detected if not provided)\nType: integer OR string\nFormat: numeric ID or 'namespace/project'\nOptional: Yes - auto-detects from current git repository\nExamples:\n - 12345 (numeric ID)\n - 'gitlab-org/gitlab' (namespace/project path)\n - 'my-group/my-subgroup/my-project' (nested groups)\nNote: If in a git repo with GitLab remote, this can be omitted", "type": "string" } }, "required": [ "branch", "commit_message", "actions" ], "type": "object" }

Other Tools from MCP GitLab Server

Related Tools

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

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