Skip to main content
Glama
Alosies
by Alosies

list_pipeline_jobs

Retrieve and filter jobs from a specific GitLab pipeline to monitor execution status, track progress, and identify failed or pending tasks.

Instructions

List jobs in a pipeline

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
include_retriedNoInclude retried jobs
pipeline_idYesPipeline ID
project_idYesProject ID or path
scopeNoFilter jobs by status

Implementation Reference

  • The main handler function that implements the logic for the 'list_pipeline_jobs' tool. It constructs query parameters based on input, fetches job data from the GitLab API, and returns the JSON-formatted response.
    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-34 (registration)
    Registers the 'list_pipeline_jobs' tool in the MCP SDK tool list, providing name, description, and input schema for validation.
    { 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 handler.
    export interface ListPipelineJobsParams { project_id: string; pipeline_id: number; scope?: GitLabJob['status'][]; include_retried?: boolean; }
  • src/server.ts:317-320 (registration)
    Server-side dispatch that routes 'list_pipeline_jobs' tool calls to the corresponding handler method.
    case "list_pipeline_jobs": return await this.jobHandlers.listPipelineJobs( args as unknown as ListPipelineJobsParams );
  • JSON schema for input validation of the 'list_pipeline_jobs' tool used by MCP SDK.
    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'], },

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