gitlab_list_pipeline_jobs
Retrieve detailed job information from a GitLab pipeline, including status, timing, artifacts, and runner details. Use for debugging failures, monitoring job progress, or locating specific artifacts efficiently.
Instructions
List jobs in a specific pipeline Returns: Array of jobs with status, timing, and artifact information Use when: Debugging pipeline failures, checking job status, finding artifacts Pagination: Yes (default 20 per page) Details: Includes job stage, status, duration, runner info
Example response: [{ "id": 12345, "name": "test:unit", "stage": "test", "status": "success", "created_at": "2023-01-01T10:00:00Z", "duration": 120.5, "artifacts": [{"filename": "coverage.xml"}], "web_url": "https://gitlab.com/group/project/-/jobs/12345" }]
Related tools:
gitlab_list_pipelines: Find pipeline IDs
gitlab_download_job_artifact: Get job artifacts
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| page | No | Page number for pagination Type: integer Range: ≥1 Default: 1 Example: 3 (to get the third page of results) Note: Use with per_page to navigate large result sets | |
| per_page | No | Number of results per page Type: integer Range: 1-100 Default: 20 Example: 50 (for faster browsing) Tip: Use smaller values (10-20) for detailed operations, larger (50-100) for listing | |
| pipeline_id | Yes | Pipeline ID Type: integer Format: Numeric pipeline identifier Example: 12345 How to find: From pipeline URLs or gitlab_list_pipelines response | |
| 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 |
Implementation Reference
- src/mcp_gitlab/tool_handlers.py:627-634 (handler)Handler function that executes the gitlab_list_pipeline_jobs tool. Retrieves project ID (auto-detects if needed), requires pipeline_id, fetches jobs from GitLabClient with pagination.def handle_list_pipeline_jobs(client: GitLabClient, arguments: Optional[Dict[str, Any]]) -> Dict[str, Any]: """Handle listing jobs in a pipeline""" project_id = require_project_id(client, arguments) pipeline_id = require_argument(arguments, "pipeline_id") per_page = get_argument(arguments, "per_page", DEFAULT_PAGE_SIZE) page = get_argument(arguments, "page", 1) return client.list_pipeline_jobs(project_id, pipeline_id, per_page=per_page, page=page)
- src/mcp_gitlab/server.py:927-938 (schema)MCP Tool schema definition including inputSchema with required pipeline_id and optional pagination. Registered via @server.list_tools().name=TOOL_LIST_PIPELINE_JOBS, description=desc.DESC_LIST_PIPELINE_JOBS, inputSchema={ "type": "object", "properties": { "project_id": {"type": "string", "description": desc.DESC_PROJECT_ID}, "pipeline_id": {"type": "integer", "description": desc.DESC_PIPELINE_ID}, "per_page": {"type": "integer", "description": desc.DESC_PER_PAGE, "default": DEFAULT_PAGE_SIZE, "minimum": 1, "maximum": MAX_PAGE_SIZE}, "page": {"type": "integer", "description": desc.DESC_PAGE_NUMBER, "default": 1, "minimum": 1} }, "required": ["pipeline_id"] }
- src/mcp_gitlab/tool_handlers.py:1019-1020 (registration)TOOL_HANDLERS dictionary entry mapping tool name to handler function. Used in server.handle_call_tool() for dispatch.TOOL_LIST_PIPELINE_JOBS: handle_list_pipeline_jobs, TOOL_LIST_PROJECT_JOBS: handle_list_project_jobs,
- src/mcp_gitlab/constants.py:211-211 (helper)Constant definition for the tool name string, used across modules for consistency.TOOL_LIST_PIPELINE_JOBS = "gitlab_list_pipeline_jobs"