Skip to main content
Glama
Alosies
by Alosies

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
NameRequiredDescriptionDefault
pipeline_idYesPipeline ID
project_idYesProject ID or path

Implementation Reference

  • 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), }, ], }; }
  • TypeScript interface defining the input parameters for the get_pipeline_variables tool.
    export interface GetPipelineVariablesParams { project_id: string; pipeline_id: number; }
  • 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 );

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