gitlab_list_merge_requests
List merge requests for a GitLab project to track code changes and review status. Specify the project path to retrieve open and pending merge requests.
Instructions
Lists merge requests for a given GitLab project.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| projectPath | Yes | The path of the GitLab project (e.g., "namespace/project-name"). |
Implementation Reference
- src/index.ts:149-162 (registration)Tool registration and input schema definition for gitlab_list_merge_requestsname: 'gitlab_list_merge_requests', description: 'Lists merge requests for a given GitLab project.', inputSchema: { type: 'object', properties: { projectPath: { type: 'string', description: 'The path of the GitLab project (e.g., "namespace/project-name").', }, }, required: ['projectPath'], }, },
- src/index.ts:1281-1295 (handler)Handler logic in the MCP server that processes calls to gitlab_list_merge_requests by invoking the GitLab servicecase 'gitlab_list_merge_requests': { if (!gitlabService) { throw new Error('GitLab service is not initialized.'); } const { projectPath } = args as { projectPath: string }; const result = await gitlabService.listMergeRequests(projectPath); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], }; }
- src/gitlab.service.ts:378-383 (helper)Helper method in GitLabService that performs the actual API call to list merge requests for the specified projectasync listMergeRequests(projectPath: string): Promise<GitLabMergeRequest[]> { const encodedProjectPath = encodeURIComponent(projectPath); return this.callGitLabApi<GitLabMergeRequest[]>( `projects/${encodedProjectPath}/merge_requests`, ); }
- src/gitlab.ts:129-141 (schema)Type definition for GitLabMergeRequest, the return type of the listMergeRequests method.export interface GitLabMergeRequest { id: number; iid: number; title: string; author: { name: string; username: string; }; updated_at: string; web_url: string; project_name?: string; }