Skip to main content
Glama

gitlab_update_cicd_variable

Update a CI/CD variable in GitLab by specifying the project ID, variable key, and value. Optionally configure variable masking and protection settings to enhance security.

Instructions

Update a CI/CD variable

Input Schema

NameRequiredDescriptionDefault
keyYesThe key of the variable
maskedNoWhether the variable is masked
project_idYesThe ID or URL-encoded path of the project
protectedNoWhether the variable is protected
valueYesThe value of the variable

Input Schema (JSON Schema)

{ "properties": { "key": { "description": "The key of the variable", "type": "string" }, "masked": { "description": "Whether the variable is masked", "type": "boolean" }, "project_id": { "description": "The ID or URL-encoded path of the project", "type": "string" }, "protected": { "description": "Whether the variable is protected", "type": "boolean" }, "value": { "description": "The value of the variable", "type": "string" } }, "required": [ "project_id", "key", "value" ], "type": "object" }

Implementation Reference

  • The main ToolHandler function implementing the gitlab_update_cicd_variable tool. It extracts parameters, validates required fields, calls context.ciCdManager.updateCiCdVariable, and formats the response.
    export const updateCiCdVariable: ToolHandler = async (params, context) => { const { project_id, key, value, protected: isProtected, masked, variable_type, environment_scope } = params.arguments || {}; if (!project_id || !key) { throw new McpError(ErrorCode.InvalidParams, 'project_id and key are required'); } const data = await context.ciCdManager.updateCiCdVariable(project_id as string | number, key as string, { value: value as string, protected: isProtected as boolean | undefined, masked: masked as boolean | undefined, variable_type: variable_type as 'env_var' | 'file' | undefined, environment_scope: environment_scope as string | undefined }); return formatResponse(data); };
  • The input schema definition for the gitlab_update_cicd_variable tool, specifying parameters and requirements.
    { name: 'gitlab_update_cicd_variable', description: 'Update a 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' }, value: { type: 'string', description: 'The value of the variable' }, protected: { type: 'boolean', description: 'Whether the variable is protected' }, masked: { type: 'boolean', description: 'Whether the variable is masked' } }, required: ['project_id', 'key', 'value'] } },
  • Tool registry mapping 'gitlab_update_cicd_variable' to cicdHandlers.updateCiCdVariable, along with other CI/CD tools.
    // CI/CD tools gitlab_list_trigger_tokens: cicdHandlers.listTriggerTokens, gitlab_get_trigger_token: cicdHandlers.getTriggerToken, gitlab_create_trigger_token: cicdHandlers.createTriggerToken, gitlab_update_trigger_token: cicdHandlers.updateTriggerToken, gitlab_delete_trigger_token: cicdHandlers.deleteTriggerToken, gitlab_trigger_pipeline: cicdHandlers.triggerPipeline, gitlab_list_cicd_variables: cicdHandlers.listCiCdVariables, gitlab_get_cicd_variable: cicdHandlers.getCiCdVariable, gitlab_create_cicd_variable: cicdHandlers.createCiCdVariable, gitlab_update_cicd_variable: cicdHandlers.updateCiCdVariable, gitlab_delete_cicd_variable: cicdHandlers.deleteCiCdVariable,

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