gitlab_get_project_pipelines
Retrieve GitLab project pipelines to monitor CI/CD status, with optional filtering by branch or ref for targeted workflow visibility.
Instructions
Gets pipelines for a GitLab project, optionally filtered by branch/ref.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| projectPath | Yes | The path of the GitLab project (e.g., "namespace/project-name"). | |
| ref | No | Optional: Branch or ref to filter pipelines. |
Implementation Reference
- src/gitlab.service.ts:520-527 (handler)The main handler function that executes the tool logic by calling the GitLab API to retrieve pipelines for a project, optionally filtered by ref.
async getProjectPipelines(projectPath: string, ref?: string): Promise<any[]> { const encodedProjectPath = encodeURIComponent(projectPath); let endpoint = `projects/${encodedProjectPath}/pipelines`; if (ref) { endpoint += `?ref=${encodeURIComponent(ref)}`; } return this.callGitLabApi<any[]>(endpoint); } - src/index.ts:611-627 (registration)Tool registration in the allTools array, defining the tool name, description, and input schema.
name: 'gitlab_get_project_pipelines', description: 'Gets pipelines for a GitLab project, optionally filtered by branch/ref.', inputSchema: { type: 'object', properties: { projectPath: { type: 'string', description: 'The path of the GitLab project (e.g., "namespace/project-name").', }, ref: { type: 'string', description: 'Optional: Branch or ref to filter pipelines.', }, }, required: ['projectPath'], }, }, - src/index.ts:1760-1774 (handler)The MCP server request handler that processes calls to the tool, validates GitLab service availability, extracts arguments, calls the service method, and returns the result as JSON text.
case 'gitlab_get_project_pipelines': { if (!gitlabService) { throw new Error('GitLab service is not initialized.'); } const { projectPath, ref } = args as { projectPath: string; ref?: string }; const result = await gitlabService.getProjectPipelines(projectPath, ref); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], }; }