Skip to main content
Glama
Alosies
by Alosies

create_pipeline

Create a new GitLab CI/CD pipeline for a specific project and branch, with optional environment variables to automate software builds and deployments.

Instructions

Create a new pipeline

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_idYesProject ID or path
refYesBranch or tag name
variablesNoPipeline variables

Implementation Reference

  • The core handler function that executes the create_pipeline tool logic, constructing the request and calling the GitLab API to create a pipeline.
    async createPipeline(args: CreatePipelineParams) { const requestData: any = { ref: args.ref, }; if (args.variables && args.variables.length > 0) { requestData.variables = args.variables; } const data = await this.client.post(`/projects/${encodeURIComponent(args.project_id)}/pipeline`, requestData); return { content: [ { type: 'text', text: JSON.stringify(data, null, 2), }, ], }; }
  • TypeScript interface defining the input parameters for the create_pipeline tool.
    export interface CreatePipelineParams { project_id: string; ref: string; variables?: Array<{ key: string; value: string; variable_type?: 'env_var' | 'file'; }>; }
  • MCP JSON schema and tool metadata definition for create_pipeline, used for input validation and tool listing.
    { name: 'create_pipeline', description: 'Create a new pipeline', inputSchema: { type: 'object', properties: { project_id: { type: 'string', description: 'Project ID or path', }, ref: { type: 'string', description: 'Branch or tag name', }, variables: { type: 'array', items: { type: 'object', properties: { key: { type: 'string' }, value: { type: 'string' }, variable_type: { type: 'string', enum: ['env_var', 'file'], default: 'env_var', }, }, required: ['key', 'value'], }, description: 'Pipeline variables', }, }, required: ['project_id', 'ref'], }, },
  • src/server.ts:295-298 (registration)
    Server dispatch logic that registers and routes create_pipeline tool calls to the PipelineHandlers.createPipeline method.
    case "create_pipeline": return await this.pipelineHandlers.createPipeline( args as unknown as CreatePipelineParams );
  • The pipelineTools array that registers the create_pipeline tool for inclusion in the allTools export used by the MCP server.
    import { Tool } from '@modelcontextprotocol/sdk/types.js'; export const pipelineTools: Tool[] = [ { 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'], }, }, { name: 'get_pipeline', description: 'Get details of a specific pipeline', inputSchema: { type: 'object', properties: { project_id: { type: 'string', description: 'Project ID or path', }, pipeline_id: { type: 'number', description: 'Pipeline ID', }, }, required: ['project_id', 'pipeline_id'], }, }, { name: 'create_pipeline', description: 'Create a new pipeline', inputSchema: { type: 'object', properties: { project_id: { type: 'string', description: 'Project ID or path', }, ref: { type: 'string', description: 'Branch or tag name', }, variables: { type: 'array', items: { type: 'object', properties: { key: { type: 'string' }, value: { type: 'string' }, variable_type: { type: 'string', enum: ['env_var', 'file'], default: 'env_var', }, }, required: ['key', 'value'], }, description: 'Pipeline variables', }, }, required: ['project_id', 'ref'], }, }, { name: 'retry_pipeline', description: 'Retry a failed pipeline', inputSchema: { type: 'object', properties: { project_id: { type: 'string', description: 'Project ID or path', }, pipeline_id: { type: 'number', description: 'Pipeline ID', }, }, required: ['project_id', 'pipeline_id'], }, }, { name: 'cancel_pipeline', description: 'Cancel a running pipeline', inputSchema: { type: 'object', properties: { project_id: { type: 'string', description: 'Project ID or path', }, pipeline_id: { type: 'number', description: 'Pipeline ID', }, }, required: ['project_id', 'pipeline_id'], }, }, { name: 'delete_pipeline', description: 'Delete a pipeline', inputSchema: { type: 'object', properties: { project_id: { type: 'string', description: 'Project ID or path', }, pipeline_id: { type: 'number', description: 'Pipeline ID', }, }, required: ['project_id', 'pipeline_id'], }, }, { name: 'get_pipeline_variables', description: 'Get variables of a pipeline', inputSchema: { type: 'object', properties: { project_id: { type: 'string', description: 'Project ID or path', }, pipeline_id: { type: 'number', description: 'Pipeline ID', }, }, 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