Skip to main content
Glama

gitlab_get_merge_request_changes

Retrieve the changes (diff) of a specific merge request in GitLab by providing the merge request internal ID and project ID or path. Facilitates code review and updates tracking.

Instructions

Get changes (diff) 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 that implements the tool logic by fetching merge request changes from the GitLab API endpoint `/projects/{project_id}/merge_requests/{merge_request_iid}/changes` and formatting the response.
    export const getMergeRequestChanges: 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}/changes`
      );
      return formatResponse(response.data);
    };
  • Defines the tool metadata including name, description, and input schema requiring project_id and merge_request_iid.
    {
      name: 'gitlab_get_merge_request_changes',
      description: 'Get changes (diff) 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']
      }
    },
  • Registers the tool name to its handler function from repoHandlers.
    gitlab_get_merge_request_changes: repoHandlers.getMergeRequestChanges,
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 states it 'gets changes (diff)' which implies a read-only operation, but doesn't mention authentication requirements, rate limits, pagination behavior, or what format the diff is returned in. For a tool with no annotation coverage, this leaves significant behavioral questions unanswered.

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 gets straight to the point with zero wasted words. It's appropriately sized for a simple retrieval tool and front-loads the essential information.

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

Completeness2/5

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

For a tool with no annotations and no output schema, the description is insufficient. It doesn't explain what format the changes/diff are returned in, whether authentication is required, or any error conditions. Given the complexity of merge request changes and the lack of structured documentation, the description should provide more context about the operation's behavior and output.

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 description doesn't add any parameter information beyond what's already in the schema (which has 100% coverage). The schema already fully documents both parameters with clear descriptions. The baseline of 3 is appropriate when the schema does all the parameter documentation work.

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 changes (diff)') and resource ('of a specific merge request'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'gitlab_get_merge_request' or 'gitlab_compare_branches' which might also provide change-related information.

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?

No guidance is provided about when to use this tool versus alternatives. The description doesn't mention when this tool is appropriate compared to 'gitlab_get_merge_request' (which might include changes) or 'gitlab_compare_branches' (which compares branches directly).

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