Variables

June 3, 2026 ยท View on GitHub

Project and group CI/CD variable CRUD.

!!! note "Feature toggle" Opt-in. Enable via GITLAB_TOOLSETS=variables (or GITLAB_TOOLSETS=all), list individual tools in GITLAB_TOOLS=, or activate at runtime with the discover_tools MCP tool.

Tools in this group


list_project_variables

๐Ÿ“– Read-only

List CI/CD variables for a project

Parameters

ParameterTypeRequiredDescription
project_idstringโœ“Project ID or URL-encoded path
filterobjectFilter by environment scope (e.g. '*', 'production')
pagenumberPage number for pagination (default: 1)
per_pagenumberNumber of items per page (max: 100, default: 20)

get_project_variable

๐Ÿ“– Read-only

Get a single CI/CD variable from a project

Parameters

ParameterTypeRequiredDescription
project_idstringโœ“Project ID or URL-encoded path
keystringโœ“The key of the variable
filterobjectFilter by environment scope

create_project_variable

โœ๏ธ Writes

Create a CI/CD variable for a project

Parameters

ParameterTypeRequiredDescription
project_idstringโœ“Project ID or URL-encoded path
keystringโœ“The key of the variable (must match /[a-zA-Z0-9_]+/)
valuestringโœ“The value of the variable
variable_typeenum (env_var | file)The type of variable: 'env_var' (default) or 'file'
protectedbooleanWhether the variable is only available on protected branches/tags
maskedbooleanWhether the variable value is masked in job logs
rawbooleanWhether the variable is not expanded (treated as raw string)
environment_scopestringEnvironment scope (e.g. '', 'production'). Default: ''
descriptionstringDescription of the variable

update_project_variable

โœ๏ธ Writes

Update an existing CI/CD variable in a project

Parameters

ParameterTypeRequiredDescription
project_idstringโœ“Project ID or URL-encoded path
keystringโœ“The key of the variable to update
valuestringโœ“The new value of the variable
variable_typeenum (env_var | file)The type of variable
protectedbooleanWhether the variable is protected
maskedbooleanWhether the variable value is masked in job logs
rawbooleanWhether the variable is not expanded
environment_scopestringNew environment scope to assign to the variable (renames the scope, e.g. '*', 'production'). Use filter.environment_scope to identify which variable to update when multiple share the same key.
descriptionstringDescription of the variable
filterobjectIdentifies which variable to update when multiple variables share the same key across different environment scopes

delete_project_variable

โœ๏ธ Writes

Delete a CI/CD variable from a project

Parameters

ParameterTypeRequiredDescription
project_idstringโœ“Project ID or URL-encoded path
keystringโœ“The key of the variable to delete
filterobjectFilter by environment scope to disambiguate when multiple variables share the same key

list_group_variables

๐Ÿ“– Read-only

List CI/CD variables for a group

Parameters

ParameterTypeRequiredDescription
group_idstringโœ“Group ID or URL-encoded path
filterobjectFilter by environment scope (e.g. '*', 'production')
pagenumberPage number for pagination (default: 1)
per_pagenumberNumber of items per page (max: 100, default: 20)

get_group_variable

๐Ÿ“– Read-only

Get a single CI/CD variable from a group

Parameters

ParameterTypeRequiredDescription
group_idstringโœ“Group ID or URL-encoded path
keystringโœ“The key of the variable
filterobjectFilter by environment scope

create_group_variable

โœ๏ธ Writes

Create a CI/CD variable for a group

Parameters

ParameterTypeRequiredDescription
group_idstringโœ“Group ID or URL-encoded path
keystringโœ“The key of the variable (must match /[a-zA-Z0-9_]+/)
valuestringโœ“The value of the variable
variable_typeenum (env_var | file)The type of variable: 'env_var' (default) or 'file'
protectedbooleanWhether the variable is only available on protected branches/tags
maskedbooleanWhether the variable value is masked in job logs
rawbooleanWhether the variable is not expanded (treated as raw string)
environment_scopestringEnvironment scope (e.g. '', 'production'). Default: ''
descriptionstringDescription of the variable

update_group_variable

โœ๏ธ Writes

Update an existing CI/CD variable in a group

Parameters

ParameterTypeRequiredDescription
group_idstringโœ“Group ID or URL-encoded path
keystringโœ“The key of the variable to update
valuestringโœ“The new value of the variable
variable_typeenum (env_var | file)The type of variable
protectedbooleanWhether the variable is protected
maskedbooleanWhether the variable value is masked in job logs
rawbooleanWhether the variable is not expanded
environment_scopestringNew environment scope to assign to the variable (renames the scope, e.g. '*', 'production'). Use filter.environment_scope to identify which variable to update when multiple share the same key.
descriptionstringDescription of the variable
filterobjectIdentifies which variable to update when multiple variables share the same key across different environment scopes

delete_group_variable

โœ๏ธ Writes

Delete a CI/CD variable from a group

Parameters

ParameterTypeRequiredDescription
group_idstringโœ“Group ID or URL-encoded path
keystringโœ“The key of the variable to delete
filterobjectFilter by environment scope to disambiguate when multiple variables share the same key