Skip to main content
Glama
Alosies
by Alosies

list_pipelines

Retrieve and filter CI/CD pipelines for a GitLab project by status, branch, commit, or other criteria to monitor build status and execution history.

Instructions

List pipelines in a project

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameNoFilter by pipeline name
order_byNoOrder pipelines by fieldid
per_pageNoNumber of results per page (max 100)
project_idYesProject ID or path
refNoFilter by branch or tag name
shaNoFilter by commit SHA
sortNoSort orderdesc
statusNoFilter by pipeline status
updated_afterNoFilter pipelines updated after this date (ISO 8601 format)
updated_beforeNoFilter pipelines updated before this date (ISO 8601 format)
usernameNoFilter by username of the user who triggered the pipeline
yaml_errorsNoFilter pipelines with YAML errors

Implementation Reference

  • The core handler function for the 'list_pipelines' tool. It builds query parameters based on input args and fetches the list of pipelines from the GitLab API, returning the JSON response formatted as MCP content.
    async listPipelines(args: ListPipelinesParams) { const params = new URLSearchParams(); if (args.status) params.append('status', args.status); if (args.ref) params.append('ref', args.ref); if (args.sha) params.append('sha', args.sha); if (args.yaml_errors !== undefined) params.append('yaml_errors', String(args.yaml_errors)); if (args.name) params.append('name', args.name); if (args.username) params.append('username', args.username); if (args.updated_after) params.append('updated_after', args.updated_after); if (args.updated_before) params.append('updated_before', args.updated_before); if (args.order_by) params.append('order_by', args.order_by); if (args.sort) params.append('sort', args.sort); params.append('per_page', String(args.per_page || 20)); const data = await this.client.get(`/projects/${encodeURIComponent(args.project_id)}/pipelines?${params.toString()}`); return { content: [ { type: 'text', text: JSON.stringify(data, null, 2), }, ], }; }
  • TypeScript interface defining the input parameters for the list_pipelines handler.
    export interface ListPipelinesParams { project_id: string; status?: GitLabPipeline['status']; ref?: string; sha?: string; yaml_errors?: boolean; name?: string; username?: string; updated_after?: string; updated_before?: string; order_by?: 'id' | 'status' | 'ref' | 'updated_at' | 'user_id'; sort?: 'asc' | 'desc'; per_page?: number; }
  • MCP tool registration including name, description, and JSON input schema for 'list_pipelines'. Part of the pipelineTools array exported for server registration.
    { name: 'list_pipelines', description: 'List pipelines in a project', inputSchema: { type: 'object', properties: { project_id: { type: 'string', description: 'Project ID or path', }, status: { type: 'string', enum: ['created', 'waiting_for_resource', 'preparing', 'pending', 'running', 'success', 'failed', 'canceled', 'skipped', 'manual', 'scheduled'], description: 'Filter by pipeline status', }, ref: { type: 'string', description: 'Filter by branch or tag name', }, sha: { type: 'string', description: 'Filter by commit SHA', }, yaml_errors: { type: 'boolean', description: 'Filter pipelines with YAML errors', }, name: { type: 'string', description: 'Filter by pipeline name', }, username: { type: 'string', description: 'Filter by username of the user who triggered the pipeline', }, updated_after: { type: 'string', description: 'Filter pipelines updated after this date (ISO 8601 format)', }, updated_before: { type: 'string', description: 'Filter pipelines updated before this date (ISO 8601 format)', }, order_by: { type: 'string', enum: ['id', 'status', 'ref', 'updated_at', 'user_id'], description: 'Order pipelines by field', default: 'id', }, sort: { type: 'string', enum: ['asc', 'desc'], description: 'Sort order', default: 'desc', }, per_page: { type: 'number', description: 'Number of results per page (max 100)', maximum: 100, default: 20, }, }, required: ['project_id'], }, },
  • src/server.ts:287-290 (registration)
    Dispatch handler in the main MCP server that routes 'list_pipelines' tool calls to the PipelineHandlers.listPipelines method.
    case "list_pipelines": return await this.pipelineHandlers.listPipelines( args as unknown as ListPipelinesParams );

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