Skip to main content
Glama

gitlab_get_pipeline_details

Retrieve detailed pipeline information from GitLab projects to monitor CI/CD status and troubleshoot build processes.

Instructions

Gets detailed information about a specific pipeline.

Input Schema

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

Implementation Reference

  • Core handler implementation: GitLabService.getPipelineDetails fetches the pipeline details by calling the GitLab API endpoint for the specific project and pipeline ID.
    async getPipelineDetails(projectPath: string, pipelineId: number): Promise<any> {
      const encodedProjectPath = encodeURIComponent(projectPath);
      return this.callGitLabApi<any>(
        `projects/${encodedProjectPath}/pipelines/${pipelineId}`,
      );
    }
  • src/index.ts:643-658 (registration)
    Tool registration: Defines the 'gitlab_get_pipeline_details' tool including its name, description, and input schema in the allTools array used by the MCP server.
    name: 'gitlab_get_pipeline_details',
    description: 'Gets detailed information about 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 tool call handler: The switch case in the CallToolRequestSchema handler that extracts arguments, calls GitLabService.getPipelineDetails, and formats the response as MCP content.
    case 'gitlab_get_pipeline_details': {
      if (!gitlabService) {
        throw new Error('GitLab service is not initialized.');
      }
      const { projectPath, pipelineId } = args as { projectPath: string; pipelineId: number };
      const result = await gitlabService.getPipelineDetails(projectPath, pipelineId);
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(result, null, 2),
          },
        ],
      };
    }
  • Helper method: callGitLabApi is the private utility used by getPipelineDetails to make authenticated HTTP requests to the GitLab API.
    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. It states this is a read operation ('Gets'), implying it's non-destructive, but doesn't disclose behavioral traits like authentication requirements, rate limits, error handling, or what specific details are returned (e.g., status, duration, artifacts). This leaves significant gaps for an agent to understand how to use it effectively.

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, clear sentence with no wasted words. It's front-loaded with the core purpose, making it efficient and easy to parse.

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 (a read operation with 2 parameters) and no output schema, the description is minimally adequate but incomplete. It lacks details on return values, error cases, or behavioral context, which are crucial for an agent to use it correctly without annotations to compensate.

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 already documents both parameters ('projectPath' and 'pipelineId') adequately. The description doesn't add any meaning beyond this, such as format examples for 'projectPath' or how to obtain 'pipelineId'. Baseline 3 is appropriate when the schema does the heavy lifting.

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 ('Gets') and resource ('detailed information about a specific pipeline'), making the purpose understandable. However, it doesn't differentiate from sibling tools like 'gitlab_get_pipeline_jobs' or 'gitlab_get_project_pipelines', which also retrieve pipeline-related information but with different scopes.

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?

No guidance is provided on when to use this tool versus alternatives. For example, it doesn't clarify that this retrieves details for a single pipeline by ID, unlike 'gitlab_get_project_pipelines' which lists multiple pipelines or 'gitlab_get_pipeline_jobs' which focuses on jobs within a pipeline.

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