Skip to main content
Glama

gitlab_get_cicd_variable

Retrieve a specific CI/CD variable by providing the project ID and variable key from a GitLab project using the MCP server.

Instructions

Get a specific CI/CD variable

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keyYesThe key of the variable
project_idYesThe ID or URL-encoded path of the project

Implementation Reference

  • The primary tool handler function for 'gitlab_get_cicd_variable'. It validates input parameters (project_id and key), calls the underlying CI/CD manager to retrieve the variable, and formats the response using formatResponse.
    export const getCiCdVariable: ToolHandler = async (params, context) => {
      const { project_id, key } = params.arguments || {};
      if (!project_id || !key) {
        throw new McpError(ErrorCode.InvalidParams, 'project_id and key are required');
      }
      
      const data = await context.ciCdManager.getCiCdVariable(project_id as string | number, key as string);
      return formatResponse(data);
    };
  • The JSON schema definition for the tool's input parameters, defining project_id and key as required string fields.
    {
      name: 'gitlab_get_cicd_variable',
      description: 'Get a specific CI/CD variable',
      inputSchema: {
        type: 'object',
        properties: {
          project_id: {
            type: 'string',
            description: 'The ID or URL-encoded path of the project'
          },
          key: {
            type: 'string',
            description: 'The key of the variable'
          }
        },
        required: ['project_id', 'key']
      }
    },
  • Maps the tool name 'gitlab_get_cicd_variable' to its handler function (cicdHandlers.getCiCdVariable) in the central tool registry object.
    gitlab_get_cicd_variable: cicdHandlers.getCiCdVariable,

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/rifqi96/mcp-gitlab'

If you have feedback or need assistance with the MCP directory API, please join our Discord server