gitlab_get_cicd_variable
Retrieve a specific CI/CD variable by providing the project ID and variable key from a GitLab project using the MCP server.
Instructions
Get a specific CI/CD variable
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key | Yes | The key of the variable | |
| project_id | Yes | The ID or URL-encoded path of the project |
Input Schema (JSON Schema)
{
"properties": {
"key": {
"description": "The key of the variable",
"type": "string"
},
"project_id": {
"description": "The ID or URL-encoded path of the project",
"type": "string"
}
},
"required": [
"project_id",
"key"
],
"type": "object"
}
Implementation Reference
- src/handlers/cicd-handlers.ts:108-116 (handler)The primary tool handler function for 'gitlab_get_cicd_variable'. It validates input parameters (project_id and key), calls the underlying CI/CD manager to retrieve the variable, and formats the response using formatResponse.export const getCiCdVariable: ToolHandler = async (params, context) => { const { project_id, key } = params.arguments || {}; if (!project_id || !key) { throw new McpError(ErrorCode.InvalidParams, 'project_id and key are required'); } const data = await context.ciCdManager.getCiCdVariable(project_id as string | number, key as string); return formatResponse(data); };
- src/utils/tools-data.ts:620-637 (schema)The JSON schema definition for the tool's input parameters, defining project_id and key as required string fields.{ name: 'gitlab_get_cicd_variable', description: 'Get a specific 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' } }, required: ['project_id', 'key'] } },
- src/utils/tool-registry.ts:57-57 (registration)Maps the tool name 'gitlab_get_cicd_variable' to its handler function (cicdHandlers.getCiCdVariable) in the central tool registry object.gitlab_get_cicd_variable: cicdHandlers.getCiCdVariable,