Skip to main content
Glama

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

TableJSON Schema
NameRequiredDescriptionDefault
keyYesThe key of the variable
project_idYesThe ID or URL-encoded path of the project

Implementation Reference

  • 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);
    };
  • 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']
      }
    },
  • 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,
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. It states 'Get' which implies a read operation, but doesn't disclose authentication requirements, rate limits, error conditions (e.g., what happens if the variable doesn't exist), or response format. For a tool with zero annotation coverage, this leaves significant gaps in understanding how it behaves.

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, efficient sentence that gets straight to the point with zero wasted words. It's appropriately sized for a simple retrieval operation and front-loads the core purpose immediately.

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

Completeness3/5

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

Given the tool's moderate complexity (retrieving a specific resource), no annotations, and no output schema, the description is minimally adequate but incomplete. It covers the basic purpose but lacks behavioral context, usage guidance, and output information. The agent would need to make assumptions about how this tool works in practice.

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 the schema fully documents both parameters ('key' and 'project_id'). The description adds no additional parameter information beyond what's in the schema. According to scoring rules, when schema coverage is high (>80%), the baseline is 3 even with no param info in the description.

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 verb ('Get') and resource ('a specific CI/CD variable'), making the purpose immediately understandable. It distinguishes this tool from its sibling 'gitlab_list_cicd_variables' by specifying retrieval of a single variable rather than listing multiple. However, it doesn't explicitly mention the project context, which is implied but could be more specific.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing project access), differentiate from 'gitlab_list_cicd_variables' for bulk retrieval, or specify when to use this versus 'gitlab_update_cicd_variable' or 'gitlab_delete_cicd_variable'. The agent must infer usage from the name alone.

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