Skip to main content
Glama

list_pipelines

Retrieve CI/CD pipeline data from GitLab projects using filters for status, branch, and pagination to monitor deployment workflows.

Instructions

列出專案的 CI/CD Pipelines

Args: project_id: 專案 ID 或路徑 status: 狀態篩選(running, pending, success, failed, canceled, skipped) ref: 分支或標籤名稱篩選 page: 頁碼 per_page: 每頁筆數

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_idYes
statusNo
refNo
pageNo
per_pageNo

Implementation Reference

  • The actual implementation of the list_pipelines method, which interacts with the GitLab API.
    def list_pipelines(
        self,
        project_id: int | str,
        status: str = None,
        ref: str = None,
        page: int = 1,
        per_page: int = 20,
    ) -> list[dict]:
        """GET /projects/:id/pipelines"""
        pid = self._resolve_project_id(project_id)
        params = {"page": page, "per_page": per_page}
        if status:
            params["status"] = status
        if ref:
            params["ref"] = ref
        return self._get_json(f"/projects/{pid}/pipelines", params=params)
  • The MCP tool registration and wrapper function for list_pipelines.
    @mcp.tool()
    def list_pipelines(project_id: int | str, status: str = None,
                       ref: str = None, page: int = 1, per_page: int = 20) -> str:
        """列出專案的 CI/CD Pipelines
    
        Args:
            project_id: 專案 ID 或路徑
            status: 狀態篩選(running, pending, success, failed, canceled, skipped)
            ref: 分支或標籤名稱篩選
            page: 頁碼
            per_page: 每頁筆數
        """
        try:
            if status:
                v = GitLabValidator.validate_pipeline_status(status)
                if not v.is_valid:
                    return "\n".join(v.errors)
    
            client = get_client()
            pipelines = client.list_pipelines(project_id, status=status, ref=ref,
                                              page=page, per_page=per_page)
            if not pipelines:
                return "找不到符合條件的 Pipeline"
    
            status_emoji = {
                "success": "✅", "failed": "❌", "running": "🔄",
                "pending": "⏳", "canceled": "⛔", "skipped": "⏭️",
                "created": "🆕", "manual": "👋"
            }
            lines = [f"找到 {len(pipelines)} 個 Pipeline:\n"]
            for p in pipelines:

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

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