Skip to main content
Glama

gitlab_get_pipeline_jobs

Retrieve jobs from a specific GitLab pipeline to monitor execution status and identify issues in CI/CD workflows.

Instructions

Gets jobs for a specific pipeline.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectPathYesThe path of the GitLab project.
pipelineIdYesThe ID of the pipeline.

Implementation Reference

  • The core handler function implementing the gitlab_get_pipeline_jobs tool. It encodes the project path and calls the GitLab API to retrieve the list of jobs for the specified pipeline.
    async getPipelineJobs(projectPath: string, pipelineId: number): Promise<any[]> {
      const encodedProjectPath = encodeURIComponent(projectPath);
      return this.callGitLabApi<any[]>(
        `projects/${encodedProjectPath}/pipelines/${pipelineId}/jobs`,
      );
    }
  • src/index.ts:660-677 (registration)
    Registration of the 'gitlab_get_pipeline_jobs' tool in the MCP tools list, including its description and input schema definition.
    {
      name: 'gitlab_get_pipeline_jobs',
      description: 'Gets jobs for a specific pipeline.',
      inputSchema: {
        type: 'object',
        properties: {
          projectPath: {
            type: 'string',
            description: 'The path of the GitLab project.',
          },
          pipelineId: {
            type: 'number',
            description: 'The ID of the pipeline.',
          },
        },
        required: ['projectPath', 'pipelineId'],
      },
    },
  • MCP request handler case for 'gitlab_get_pipeline_jobs' that validates GitLab service availability, extracts arguments, calls the service method, and returns the JSON-formatted result.
    case 'gitlab_get_pipeline_jobs': {
      if (!gitlabService) {
        throw new Error('GitLab service is not initialized.');
      }
      const { projectPath, pipelineId } = args as { projectPath: string; pipelineId: number };
      const result = await gitlabService.getPipelineJobs(projectPath, pipelineId);
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(result, null, 2),
          },
        ],
      };
    }
  • Helper method used by getPipelineJobs to make authenticated HTTP requests to the GitLab API, handling errors and JSON parsing.
    private async callGitLabApi<T>(
      endpoint: string,
      method: string = 'GET',
      body?: object,
    ): Promise<T> {
      const url = `${this.config.url}/api/v4/${endpoint}`;
      const headers = {
        'Private-Token': this.config.accessToken,
        'Content-Type': 'application/json',
      };
    
      const options: any = {
        method,
        headers,
        body: body ? JSON.stringify(body) : undefined,
      };
    
      try {
        const response = await fetch(url, options);
        if (!response.ok) {
          const errorText = await response.text();
          console.error(`GitLab API Error: ${response.status} - ${errorText}`);
          throw new Error(`GitLab API Error: ${response.status} - ${errorText}`);
        }
        return response.json() as Promise<T>;
      } catch (error) {
        console.error(`Failed to call GitLab API: ${error}`);
        throw error;
      }
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states 'Gets jobs' but does not clarify if this is a read-only operation, what permissions are needed, whether it's paginated, or what the output format might be. For a tool with zero annotation coverage, this leaves significant gaps in understanding its behavior and constraints.

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 with no wasted words, making it easy to parse. It is front-loaded with the core purpose, though it could benefit from more detail. This meets the criteria for conciseness and structure without unnecessary elaboration.

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?

Given the lack of annotations and output schema, the description is incomplete for a tool that likely returns complex job data. It does not address behavioral aspects like read-only nature, error handling, or output structure. With 100% schema coverage for inputs but no output information, the description fails to provide enough context for effective use.

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%, with both parameters ('projectPath' and 'pipelineId') documented in the schema. The description does not add any meaning beyond this, such as explaining parameter formats or relationships. Given the high schema coverage, the baseline score of 3 is appropriate, as the schema handles the parameter documentation adequately.

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

Purpose3/5

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

The description 'Gets jobs for a specific pipeline' clearly states the action ('Gets') and target resource ('jobs for a specific pipeline'), making the purpose understandable. However, it does not differentiate from sibling tools like 'gitlab_get_job_logs' or 'gitlab_get_pipeline_details', which could cause confusion about scope. It's not tautological but remains somewhat vague about what 'jobs' entails.

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. With siblings like 'gitlab_get_job_logs' (for logs) and 'gitlab_get_pipeline_details' (for pipeline metadata), there is no indication of context, prerequisites, or exclusions. Usage is implied only by the name, lacking explicit instructions.

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

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/HainanZhao/mcp-gitlab-jira'

If you have feedback or need assistance with the MCP directory API, please join our Discord server