Skip to main content
Glama

gitlab_get_user_merge_commits

Track merge commits performed by a specific user in GitLab to monitor merge activity, analyze workflows, and ensure quality assurance. Filter by user, project, branch, or timeframe for targeted insights.

Instructions

List merge commits where a specific user performed the merge.

Shows commits where the user merged branches (not necessarily the code author). Use this tool to see what merges a user has performed, useful for release management.

Examples:

  • Release management: get_user_merge_commits(user_id=123)

  • Merge activity tracking

  • Integration oversight

For all commits authored by user, use 'gitlab_get_user_commits' instead.

Find all commits that originated from merge requests created by the specified user, tracking their integrated contributions.

Returns merge-related commits with:

  • Commit details: SHA, message, merge info

  • MR context: original MR, review process

  • Integration info: target branch, merge strategy

  • Quality metrics: review feedback, CI results

  • Timeline: development to integration time

Use cases:

  • Track integrated contributions

  • Measure code review effectiveness

  • Analyze development workflows

  • Quality assurance reporting

Parameters:

  • user_id: Numeric user ID

  • username: Username string (use either user_id or username)

  • project_id: Optional project scope filter

  • target_branch: Filter by target branch (e.g., main)

  • since: MRs merged after date (YYYY-MM-DD)

  • until: MRs merged before date (YYYY-MM-DD)

  • include_review_metrics: Include review statistics

  • per_page: Results per page (default: 20)

  • page: Page number (default: 1)

Example: Get merged contributions to main branch

{ "username": "johndoe", "target_branch": "main", "since": "2024-01-01", "include_review_metrics": true }

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pageNoPage number for pagination Type: integer Range: ≥1 Default: 1 Example: 3 (to get the third page of results) Note: Use with per_page to navigate large result sets
per_pageNoNumber of results per page Type: integer Range: 1-100 Default: 20 Example: 50 (for faster browsing) Tip: Use smaller values (10-20) for detailed operations, larger (50-100) for listing
project_idNoOptional project scope filter
sinceNoCommits after date (YYYY-MM-DD)
untilNoCommits before date (YYYY-MM-DD)
usernameYesUsername string

Implementation Reference

  • The handler function that implements the core logic of the 'gitlab_get_user_merge_commits' tool. It extracts parameters from the input arguments and delegates to the GitLabClient's get_user_merge_commits method to fetch the user's merge commits.
    def handle_get_user_merge_commits(client: GitLabClient, arguments: Optional[Dict[str, Any]]) -> Dict[str, Any]: """Handle getting user's merge commits""" username = get_argument(arguments, "username") if not username: raise ValueError("username is required") project_id = get_argument(arguments, "project_id") since = get_argument(arguments, "since") until = get_argument(arguments, "until") per_page = get_argument(arguments, "per_page", DEFAULT_PAGE_SIZE) page = get_argument(arguments, "page", 1) return client.get_user_merge_commits( username=username, project_id=project_id, since=since, until=until, per_page=per_page, page=page )
  • Pydantic/MCP schema definition for the tool, specifying input parameters, types, descriptions, defaults, and requirements.
    types.Tool( name=TOOL_GET_USER_MERGE_COMMITS, description=desc.DESC_GET_USER_MERGE_COMMITS, inputSchema={ "type": "object", "properties": { "username": {"type": "string", "description": "Username string"}, "project_id": {"type": "string", "description": "Optional project scope filter"}, "since": {"type": "string", "description": "Merges after date (YYYY-MM-DD)"}, "until": {"type": "string", "description": "Merges before date (YYYY-MM-DD)"}, "per_page": {"type": "integer", "description": desc.DESC_PER_PAGE, "default": DEFAULT_PAGE_SIZE, "minimum": 1, "maximum": MAX_PAGE_SIZE}, "page": {"type": "integer", "description": desc.DESC_PAGE_NUMBER, "default": 1, "minimum": 1} }, "required": ["username"] } ),
  • Registration of the tool handler in the TOOL_HANDLERS dictionary, mapping the tool name to its execution function. This dict is used by the MCP server to dispatch tool calls.
    TOOL_GET_USER_COMMITS: handle_get_user_commits, TOOL_GET_USER_MERGE_COMMITS: handle_get_user_merge_commits,
  • Constant definition of the tool name string used throughout the codebase for consistency.
    TOOL_GET_USER_MERGE_COMMITS = "gitlab_get_user_merge_commits"

Other Tools

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

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