Skip to main content
Glama

gitlab_get_merge_request

Retrieve detailed information about a specific GitLab merge request by providing the project ID and merge request internal ID, enabling streamlined code review and collaboration.

Instructions

Get details of a specific merge request

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
merge_request_iidYesThe internal ID of the merge request
project_idYesThe ID or URL-encoded path of the project

Implementation Reference

  • The main handler function for gitlab_get_merge_request tool. It extracts project_id and merge_request_iid from arguments, validates them, makes a GET request to the GitLab API endpoint for the specific merge request, and formats the response.
    export const getMergeRequest: ToolHandler = async (params, context) => {
      const { project_id, merge_request_iid } = params.arguments || {};
      if (!project_id || !merge_request_iid) {
        throw new McpError(ErrorCode.InvalidParams, 'project_id and merge_request_iid are required');
      }
      
      const response = await context.axiosInstance.get(
        `/projects/${encodeURIComponent(String(project_id))}/merge_requests/${merge_request_iid}`
      );
      return formatResponse(response.data);
    };
  • The input schema definition for the gitlab_get_merge_request tool, specifying required parameters project_id (string) and merge_request_iid (number).
    {
      name: 'gitlab_get_merge_request',
      description: 'Get details of a specific merge request',
      inputSchema: {
        type: 'object',
        properties: {
          project_id: {
            type: 'string',
            description: 'The ID or URL-encoded path of the project'
          },
          merge_request_iid: {
            type: 'number',
            description: 'The internal ID of the merge request'
          }
        },
        required: ['project_id', 'merge_request_iid']
      }
  • Registration of the gitlab_get_merge_request tool in the central tool registry, mapping the tool name to its handler function repoHandlers.getMergeRequest.
    gitlab_get_merge_request: repoHandlers.getMergeRequest,
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states 'Get details' which implies a read-only operation, but doesn't disclose behavioral traits like authentication requirements, rate limits, error conditions (e.g., invalid IDs), or what 'details' includes (e.g., status, author, comments). For a tool with no annotations, this leaves significant gaps in understanding its behavior.

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

Conciseness5/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 ('Get details of a specific merge request') with zero wasted words. It's appropriately sized for a straightforward retrieval tool, making it easy to parse quickly.

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 the tool's low complexity (2 required parameters, no nested objects) and high schema coverage, the description is minimally adequate. However, with no annotations and no output schema, it fails to explain what 'details' are returned (e.g., JSON structure, fields like title or state), leaving the agent uncertain about the response format. This gap reduces completeness for effective tool invocation.

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?

The input schema has 100% description coverage, clearly documenting both parameters ('merge_request_iid' and 'project_id'). The description adds no additional meaning beyond the schema, such as explaining parameter relationships or usage examples. With high schema coverage, the baseline score of 3 is appropriate as the 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 action ('Get details') and resource ('specific merge request'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'gitlab_get_merge_request_changes' or 'gitlab_list_merge_requests', which would require more specificity about what 'details' encompasses.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing project access), contrast with 'gitlab_get_merge_request_changes' (which focuses on diff details) or 'gitlab_list_merge_requests' (which retrieves multiple MRs), or specify use cases like reviewing MR metadata.

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

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

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