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
| Name | Required | Description | Default |
|---|---|---|---|
| merge_request_iid | Yes | The internal ID of the merge request | |
| project_id | Yes | The 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); };
- src/utils/tools-data.ts:88-104 (schema)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'] }
- src/utils/tool-registry.ts:28-28 (registration)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,