Skip to main content
Glama
Alosies
by Alosies

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
NameRequiredDescriptionDefault
project_idYesProject ID or path
pipeline_idYesPipeline ID
scopeNoFilter jobs by status
include_retriedNoInclude retried jobs

Implementation Reference

  • 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), }, ], }; }
  • 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'], },
  • 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 );

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/Alosies/gitlab-mcp-server'

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