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
| Name | Required | Description | Default |
|---|---|---|---|
| key | Yes | The key of the variable | |
| masked | No | Whether the variable is masked | |
| project_id | Yes | The ID or URL-encoded path of the project | |
| protected | No | Whether the variable is protected | |
| value | Yes | The 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
- src/handlers/cicd-handlers.ts:141-155 (handler)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); };
- src/utils/tools-data.ts:668-697 (schema)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'] } },
- src/utils/tool-registry.ts:49-61 (registration)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,