Skip to main content
Glama
harshmaur

GitLab MCP Server

by harshmaur

get_merge_request

Retrieve merge request details from GitLab projects by providing project ID and either merge request IID or source branch name.

Instructions

Get details of a merge request (Either mergeRequestIid or branchName must be provided)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_idYesProject ID or complete URL-encoded path to project
merge_request_iidNoThe IID of a merge request
source_branchNoSource branch name

Implementation Reference

  • Zod input schema for the get_merge_request tool, defining parameters like project_id, merge_request_iid, and source_branch.
    export const GetMergeRequestSchema = ProjectParamsSchema.extend({
      merge_request_iid: z.number().optional().describe("The IID of a merge request"),
      source_branch: z.string().optional().describe("Source branch name"),
    });
  • Zod output schema for merge request data returned by the get_merge_request tool.
    export const GitLabMergeRequestSchema = z.object({
      id: z.number(),
      iid: z.number(),
      project_id: z.number(),
      title: z.string(),
      description: z.string().nullable(),
      state: z.string(),
      merged: z.boolean().optional(),
      draft: z.boolean().optional(),
      author: GitLabUserSchema,
      assignees: z.array(GitLabUserSchema).optional(),
      reviewers: z.array(GitLabUserSchema).optional(),
      source_branch: z.string(),
      target_branch: z.string(),
      diff_refs: GitLabMergeRequestDiffRefSchema.nullable().optional(),
      web_url: z.string(),
      created_at: z.string(),
      updated_at: z.string(),
      merged_at: z.string().nullable(),
      closed_at: z.string().nullable(),
      merge_commit_sha: z.string().nullable(),
      detailed_merge_status: z.string().optional(),
      merge_status: z.string().optional(),
      merge_error: z.string().nullable().optional(),
      work_in_progress: z.boolean().optional(),
      blocking_discussions_resolved: z.boolean().optional(),
      should_remove_source_branch: z.boolean().nullable().optional(),
      force_remove_source_branch: z.boolean().nullable().optional(),
      allow_collaboration: z.boolean().optional(),
      allow_maintainer_to_push: z.boolean().optional(),
      changes_count: z.string().nullable().optional(),
      merge_when_pipeline_succeeds: z.boolean().optional(),
      squash: z.boolean().optional(),
      labels: z.array(z.string()).optional(),
    });
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It only mentions the parameter requirement without describing what 'details' are returned, whether this is a read-only operation, authentication needs, error conditions, or rate limits. For a tool with 3 parameters and no annotation coverage, this leaves significant behavioral gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the core purpose. However, the parenthetical note about parameters could be better integrated, and there's a minor terminology mismatch ('branchName' vs 'source_branch'). Overall, it's appropriately concise with minimal waste.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given 3 parameters with 100% schema coverage but no annotations and no output schema, the description is minimally adequate. It covers the basic purpose and parameter requirement but lacks behavioral context about what 'details' means, authentication requirements, or error handling. For a read operation with no output schema, more information about return values would be helpful.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema already documents all parameters thoroughly. The description adds marginal value by clarifying the either/or relationship between mergeRequestIid and source_branch (though it incorrectly references 'branchName' instead of 'source_branch'), but doesn't provide additional semantic context beyond what's in the schema. Baseline 3 is appropriate when schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'Get' and resource 'details of a merge request', making the purpose unambiguous. It distinguishes from sibling tools like 'list_merge_requests' by focusing on retrieving details of a specific merge request rather than listing multiple. However, it doesn't explicitly differentiate from 'get_merge_request_diffs' which also retrieves merge request information.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides implied usage guidance by stating 'Either mergeRequestIid or branchName must be provided', which helps understand parameter requirements. However, it doesn't explicitly state when to use this tool versus alternatives like 'get_merge_request_diffs' or 'list_merge_requests', nor does it mention prerequisites or contextual constraints beyond the parameter requirement.

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

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