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
| Name | Required | Description | Default |
|---|---|---|---|
| project_id | No | Project 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 | |
| ref | No | Branch 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
- src/mcp_gitlab/tool_handlers.py:244-250 (handler)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)
- src/mcp_gitlab/tool_handlers.py:1008-1010 (registration)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,
- src/mcp_gitlab/server.py:506-516 (schema)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} } } ),
- src/mcp_gitlab/constants.py:183-183 (helper)Constant definition for the tool name string, used consistently across handler registration, schema definitions, and server.TOOL_LIST_PIPELINES = "gitlab_list_pipelines"