get_pipeline_variables
Retrieve variables configured for a specific GitLab CI/CD pipeline to access runtime configuration values and secrets used during pipeline execution.
Instructions
Get variables of a pipeline
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pipeline_id | Yes | Pipeline ID | |
| project_id | Yes | Project ID or path |
Implementation Reference
- src/handlers/pipelines.ts:113-124 (handler)Handler function that executes the get_pipeline_variables tool by fetching pipeline variables from the GitLab API and returning them as JSON.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/types.ts:389-392 (schema)TypeScript interface defining the input parameters for the get_pipeline_variables tool.export interface GetPipelineVariablesParams { project_id: string; pipeline_id: number; }
- src/tools/pipelines.ts:176-193 (registration)Tool registration in the pipelineTools array, including name, description, and input schema for MCP.{ 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/server.ts:311-314 (registration)Dispatch case in the MCP server that routes calls to the pipeline handler for get_pipeline_variables.case "get_pipeline_variables": return await this.pipelineHandlers.getPipelineVariables( args as unknown as GetPipelineVariablesParams );