Skip to main content
Glama

gitlab_list_pipelines

Retrieve CI/CD pipeline statuses to monitor builds, identify failures, and track progress across branches or tags in GitLab projects.

Instructions

List CI/CD pipelines Returns: Pipeline runs with status Use when: Checking CI status, finding failures Filtering: By ref (branch), status

Statuses:

  • running: Currently executing

  • pending: Waiting to start

  • success: Passed

  • failed: Failed

  • canceled: Manually canceled

  • skipped: Skipped

Example response: [{ "id": 123456, "status": "success", "ref": "main", "sha": "abc123...", "created_at": "2024-01-15T10:00:00Z", "duration": 300 }]

Related tools:

  • gitlab_get_pipeline: Full pipeline details

  • gitlab_summarize_pipeline: AI-friendly summary

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_idNoProject identifier (auto-detected if not provided) Type: integer OR string Format: numeric ID or 'namespace/project' Optional: Yes - auto-detects from current git repository Examples: - 12345 (numeric ID) - 'gitlab-org/gitlab' (namespace/project path) - 'my-group/my-subgroup/my-project' (nested groups) Note: If in a git repo with GitLab remote, this can be omitted
refNoBranch or tag name Type: string Format: Valid git reference name Optional: Yes Examples: - 'main' (main branch) - 'develop' (development branch) - 'feature/user-auth' (feature branch) - 'v1.0.0' (version tag) - 'release-2024.01' (release tag)

Implementation Reference

  • The main handler function for gitlab_list_pipelines. Resolves the project ID (auto-detects from git if not provided), extracts optional ref parameter, and delegates to GitLabClient.get_pipelines() to fetch the pipelines.
    def handle_list_pipelines(client: GitLabClient, arguments: Optional[Dict[str, Any]]) -> Any:
        """Handle listing pipelines"""
        project_id = require_project_id(client, arguments)
        ref = get_argument(arguments, "ref")
        
        return client.get_pipelines(project_id, ref)
  • Registration of the handler function in the TOOL_HANDLERS dictionary, which is used by server.py to dispatch tool calls to the appropriate handler.
    TOOL_LIST_PIPELINES: handle_list_pipelines,
    TOOL_LIST_USER_EVENTS: handle_get_user_events,
    TOOL_LIST_COMMITS: handle_get_commits,
  • MCP tool schema definition and registration in the server's list_tools() method, defining the tool name, description, and input schema (project_id and optional ref).
    types.Tool(
        name=TOOL_LIST_PIPELINES,
        description=desc.DESC_LIST_PIPELINES,
        inputSchema={
            "type": "object",
            "properties": {
                "project_id": {"type": "string", "description": desc.DESC_PROJECT_ID},
                "ref": {"type": "string", "description": desc.DESC_BRANCH_TAG_REF}
            }
        }
    ),
  • Tool schema definition in tool_definitions.py (possibly used as a template or reference). Defines input schema matching the handler parameters.
        name=TOOL_LIST_PIPELINES,
        description=desc.DESC_LIST_PIPELINES,
        inputSchema={
            "type": "object",
            "properties": {
                "project_id": {"type": "string", "description": desc.DESC_PROJECT_ID},
                "ref": {"type": "string", "description": desc.DESC_BRANCH_TAG_REF}
            }
        }
    ),
  • Constant definition for the tool name string, used consistently across handler registration, schema definitions, and server.
    TOOL_LIST_PIPELINES = "gitlab_list_pipelines"
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden. It discloses key behavioral traits: the tool returns pipeline runs with status, lists available statuses with explanations, provides a detailed example response format, and mentions filtering capabilities. It doesn't cover rate limits, authentication needs, or pagination behavior, but provides substantial operational context.

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

Conciseness4/5

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

Well-structured with clear sections (description, returns, use when, filtering, statuses, example, related tools). Each section earns its place, though the status list and example response are somewhat verbose for a description. The information is front-loaded with the core purpose first.

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

Completeness4/5

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

For a read-only listing tool with no output schema, the description provides excellent context: clear purpose, usage guidelines, behavioral details (status explanations, example response), and sibling relationships. It doesn't cover all possible edge cases or pagination, but gives the agent enough to use the tool effectively.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema already fully documents both parameters. The description mentions filtering 'By ref (branch), status' which aligns with the 'ref' parameter but doesn't add meaningful semantic information beyond what's in the schema. The baseline of 3 is appropriate when the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('List') and resource ('CI/CD pipelines') with specific scope. It distinguishes from sibling tools by mentioning 'gitlab_get_pipeline' for full details and 'gitlab_summarize_pipeline' for AI-friendly summaries, establishing its role as a listing tool.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicit 'Use when' section provides clear context ('Checking CI status, finding failures'). It names specific alternative tools ('gitlab_get_pipeline', 'gitlab_summarize_pipeline') for different use cases, giving the agent explicit guidance on when to choose this tool versus alternatives.

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

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