CI Variable
gitlab_ci_variableManage GitLab CI/CD variables across project, group, and instance scopes. Create, update, list, get, and delete variables with environment scoping support for per-env values.
Instructions
Example: {"action":"create","params":{...}} For the params schema of any action, read the MCP resource gitlab://schema/meta/gitlab_ci_variable/.
Manage GitLab CI/CD variables at instance, group, and project scope. Delete actions are irreversible. When to use: define / rotate / unmask / scope CI/CD variables at project, group, or instance level, both regular and secret (masked / masked_and_hidden), with environment scoping for per-env values. NOT for: linting CI YAML or browsing CI templates (use gitlab_template), pipeline runs or schedules (use gitlab_pipeline), feature flags (use gitlab_feature_flags), per-deployment env metadata (use gitlab_environment), GitLab instance settings (use gitlab_admin).
Returns:
list / group_list / instance_list: arrays of variable objects {key, value (or hidden), variable_type, protected, masked, raw, environment_scope, description} with pagination.
get / create / update / group_get / group_create / group_update / instance_get / instance_create / instance_update: single variable object.
delete / group_delete / instance_delete: {success, message}. Errors: 404 (hint: a (key, environment_scope) pair must exist for get/update/delete — supply environment_scope when the variable is env-scoped), 403 (hint: project requires Maintainer+, group requires Owner, instance requires admin), 400 (hint: variable_type ∈ env_var/file; masked requires single-line non-empty value matching GitLab's masking rules).
Param conventions: * = required. Project-scoped actions need project_id*, group-scoped need group_id*, instance-scoped need no ID. Common optional params: variable_type, protected, masked, raw, environment_scope.
Project variables:
list: project_id*
get / delete: project_id*, key*, environment_scope
create: project_id*, key*, value*, description, variable_type, protected, masked, masked_and_hidden, raw, environment_scope
update: project_id*, key*, value, description, variable_type, protected, masked, raw, environment_scope
Group variables (group_*):
group_list: group_id*
group_get / group_delete: group_id*, key*
group_create: group_id*, key*, value*, description, variable_type, protected, masked, raw, environment_scope
group_update: group_id*, key*, value, description, variable_type, protected, masked, raw, environment_scope
Instance variables (instance_*):
instance_list: (no params)
instance_get / instance_delete: key*
instance_create: key*, value*, description, variable_type, protected, masked, raw
instance_update: key*, value, description, variable_type, protected, masked, raw
See also: gitlab_pipeline (pipeline operations), gitlab_template (CI lint)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action | Yes | Action to perform. Pick exactly one of the values in `enum`. Each action expects its own `params` object — see the tool description for the per-action parameter list. | |
| params | No | Action-specific parameters as a JSON object. Required and optional fields differ per action; consult this tool's description for the chosen action. Send only the fields documented for that action — unknown keys are rejected with a validation error (only reserved meta keys like `confirm` are stripped before validation). For the JSON Schema of a specific action's `params`, read the MCP resource `gitlab://schema/meta/{tool}/{action}` (replace placeholders with the tool name and the chosen action). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| next_steps | No | Optional. Suggested follow-up actions or tool calls for the LLM, contextual to the result. | |
| pagination | No | Present on list actions. Use `has_more` and `next_page` to paginate through results. |