list_pipeline_jobs
Retrieve and filter jobs within a GitLab pipeline to monitor execution status and troubleshoot issues.
Instructions
List jobs in a pipeline
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_id | Yes | Project ID or path | |
| pipeline_id | Yes | Pipeline ID | |
| scope | No | Filter jobs by status | |
| include_retried | No | Include retried jobs |
Implementation Reference
- src/handlers/jobs.ts:11-29 (handler)Core handler function that constructs query parameters based on input and fetches the list of jobs from the GitLab API for the specified project and pipeline, returning the JSON response as text content.async listPipelineJobs(args: ListPipelineJobsParams) { const params = new URLSearchParams(); if (args.scope && args.scope.length > 0) { args.scope.forEach((status: string) => params.append('scope[]', status)); } if (args.include_retried !== undefined) params.append('include_retried', String(args.include_retried)); const data = await this.client.get(`/projects/${encodeURIComponent(args.project_id)}/pipelines/${args.pipeline_id}/jobs?${params.toString()}`); return { content: [ { type: 'text', text: JSON.stringify(data, null, 2), }, ], }; }
- src/tools/jobs.ts:4-33 (schema)Tool registration including name, description, and detailed input schema for validating parameters like project_id, pipeline_id, scope, and include_retried.{ name: 'list_pipeline_jobs', description: 'List jobs in a pipeline', inputSchema: { type: 'object', properties: { project_id: { type: 'string', description: 'Project ID or path', }, pipeline_id: { type: 'number', description: 'Pipeline ID', }, scope: { type: 'array', items: { type: 'string', enum: ['created', 'pending', 'running', 'failed', 'success', 'canceled', 'skipped', 'waiting_for_resource', 'manual'], }, description: 'Filter jobs by status', }, include_retried: { type: 'boolean', description: 'Include retried jobs', default: false, }, }, required: ['project_id', 'pipeline_id'], },
- src/types.ts:382-387 (schema)TypeScript interface defining the input parameters for the list_pipeline_jobs tool, imported and used in handler and server.export interface ListPipelineJobsParams { project_id: string; pipeline_id: number; scope?: GitLabJob['status'][]; include_retried?: boolean; }
- src/server.ts:317-320 (registration)Switch case in the CallToolRequest handler that routes calls to 'list_pipeline_jobs' to the appropriate JobHandlers method.case "list_pipeline_jobs": return await this.jobHandlers.listPipelineJobs( args as unknown as ListPipelineJobsParams );