Skip to main content
Glama

MCP GitLab Server

by Vijay-Duke

gitlab_compare_refs

Compare Git references to review changes before merging. Shows commits and diffs between two branches, tags, or commits. Use to analyze feature branch updates against main or other points.

Instructions

Compare two git references Returns: Commits and diffs between refs Use when: Reviewing changes before merge Shows: What changed between two points

Example: Compare feature branch to main

  • from: "main"

  • to: "feature/new-feature" Shows all changes in feature branch

Related tools:

  • gitlab_create_merge_request: Create MR from comparison

  • gitlab_smart_diff: Advanced diff options

Input Schema

NameRequiredDescriptionDefault
from_refYesSource reference for comparison Type: string Required: Yes Format: Branch, tag, or commit SHA Examples: - 'feature/new-api' (branch) - 'v1.0.0' (tag) - 'abc123def' (commit) Use case: Starting point for comparison
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
straightNoDiff type Type: boolean Default: false Options: - true: Direct comparison (A..B) - false: Three-dot comparison (A...B) Explanation: - Direct: All changes between two points - Three-dot: Changes in B since common ancestor Use case: false for MR-style diffs, true for direct comparison
to_refYesTarget reference for comparison Type: string Required: Yes Format: Branch, tag, or commit SHA Examples: - 'main' (branch) - 'v2.0.0' (tag) - '456789abc' (commit) Use case: Ending point for comparison

Input Schema (JSON Schema)

{ "properties": { "from_ref": { "description": "Source reference for comparison\nType: string\nRequired: Yes\nFormat: Branch, tag, or commit SHA\nExamples:\n - 'feature/new-api' (branch)\n - 'v1.0.0' (tag)\n - 'abc123def' (commit)\nUse case: Starting point for comparison", "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" }, "straight": { "default": false, "description": "Diff type\nType: boolean\nDefault: false\nOptions:\n - true: Direct comparison (A..B)\n - false: Three-dot comparison (A...B)\nExplanation:\n - Direct: All changes between two points\n - Three-dot: Changes in B since common ancestor\nUse case: false for MR-style diffs, true for direct comparison", "type": "boolean" }, "to_ref": { "description": "Target reference for comparison\nType: string\nRequired: Yes\nFormat: Branch, tag, or commit SHA\nExamples:\n - 'main' (branch)\n - 'v2.0.0' (tag)\n - '456789abc' (commit)\nUse case: Ending point for comparison", "type": "string" } }, "required": [ "from_ref", "to_ref" ], "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