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

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

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:
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 mentions pagination parameters (page, per_page) which hints at paginated results, but doesn't describe the return format, error conditions, rate limits, authentication requirements, or whether this is a read-only operation. The description is minimal and lacks behavioral context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately concise with a clear purpose statement followed by parameter explanations. However, the structure could be improved by front-loading more critical information (like behavioral traits) rather than just listing parameters. The parameter section is useful but makes the description somewhat parameter-heavy relative to other context.

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

Completeness3/5

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

Given that there's an output schema (which handles return values), no annotations, and 5 parameters with good semantic coverage in the description, the description is moderately complete. However, it lacks important behavioral context (authentication, errors, rate limits) and usage guidance relative to sibling tools, leaving gaps for an AI agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description adds significant value beyond the schema, which has 0% description coverage. It provides Chinese translations and clarifies parameter purposes: '專案 ID 或路徑' (project ID or path) for project_id, '狀態篩選' (status filter) with enumerated values for status, '分支或標籤名稱篩選' (branch or tag name filter) for ref, and pagination context for page/per_page. This compensates well for the schema's lack of descriptions.

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 tool's purpose: '列出專案的 CI/CD Pipelines' (List project's CI/CD pipelines). It specifies the verb ('list') and resource ('CI/CD pipelines'), though it doesn't explicitly differentiate from sibling tools like 'get_pipeline' or 'list_pipeline_jobs'.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools like 'get_pipeline' (for single pipeline details) or 'list_pipeline_jobs' (for jobs within pipelines), nor does it specify prerequisites or contextual usage scenarios.

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

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