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

TableJSON 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

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,
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden but offers minimal behavioral insight. 'Update' implies mutation, but it doesn't disclose permission requirements, whether changes are reversible, error conditions, or what happens to unspecified fields. For a mutation tool with zero annotation coverage, this is inadequate.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, direct sentence with zero wasted words. It's perfectly front-loaded and appropriately sized for the tool's complexity, making it easy to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a mutation tool with 5 parameters, no annotations, and no output schema, the description is insufficient. It doesn't address behavioral aspects like authentication needs, side effects, or return format, leaving significant gaps in understanding how to use this tool effectively.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so parameters are fully documented in the schema. The description adds no additional parameter context beyond what's already in the structured fields, meeting the baseline expectation but not providing extra value.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Update') and resource ('a CI/CD variable'), making the purpose immediately understandable. It distinguishes this from creation and deletion tools, though it doesn't explicitly differentiate from other update operations like gitlab_update_merge_request.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives. While the name suggests it's for updating existing variables (versus gitlab_create_cicd_variable for creation), the description doesn't mention prerequisites like needing an existing variable or when to choose this over deletion/recreation.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Related Tools

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