get_pipeline_variables
Retrieve pipeline variables from GitLab projects to access configuration data and environment settings for CI/CD workflows.
Instructions
Get variables of a pipeline
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_id | Yes | Project ID or path | |
| pipeline_id | Yes | Pipeline ID |
Implementation Reference
- src/handlers/pipelines.ts:113-124 (handler)The handler function that implements the core logic of the 'get_pipeline_variables' tool by calling the GitLab API to retrieve pipeline variables and formatting the response as MCP content.async getPipelineVariables(args: GetPipelineVariablesParams) { const data = await this.client.get(`/projects/${encodeURIComponent(args.project_id)}/pipelines/${args.pipeline_id}/variables`); return { content: [ { type: 'text', text: JSON.stringify(data, null, 2), }, ], }; }
- src/tools/pipelines.ts:176-193 (registration)MCP tool registration defining the name, description, and input schema for 'get_pipeline_variables'.{ 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'], }, },
- src/types.ts:389-392 (schema)TypeScript interface defining the input parameters: project_id (string) and pipeline_id (number).export interface GetPipelineVariablesParams { project_id: string; pipeline_id: number; }
- src/server.ts:311-314 (registration)Server dispatch case that routes the tool call to the pipelineHandlers.getPipelineVariables method.case "get_pipeline_variables": return await this.pipelineHandlers.getPipelineVariables( args as unknown as GetPipelineVariablesParams );