Skip to main content
Glama

get_pipeline

Retrieve detailed information about a specific CI/CD pipeline from a GitLab project using project and pipeline identifiers.

Instructions

取得 Pipeline 詳細資訊

Args: project_id: 專案 ID 或路徑 pipeline_id: Pipeline ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_idYes
pipeline_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The MCP tool handler for 'get_pipeline' which fetches pipeline details and formats them as a string.
    @mcp.tool()
    def get_pipeline(project_id: int | str, pipeline_id: int) -> str:
        """取得 Pipeline 詳細資訊
    
        Args:
            project_id: 專案 ID 或路徑
            pipeline_id: Pipeline ID
        """
        try:
            client = get_client()
            p = client.get_pipeline(project_id, pipeline_id)
    
            status_emoji = {
                "success": "✅", "failed": "❌", "running": "🔄",
                "pending": "⏳", "canceled": "⛔", "skipped": "⏭️"
            }
            emoji = status_emoji.get(p.get("status", ""), "⚪")
    
            return f"""{emoji} Pipeline #{p['id']}
    狀態: {p.get('status', 'N/A')}
    Ref: {p.get('ref', 'N/A')}
    SHA: {p.get('sha', 'N/A')}
    建立時間: {p.get('created_at', 'N/A')}
    更新時間: {p.get('updated_at', 'N/A')}
    開始時間: {p.get('started_at', 'N/A')}
    完成時間: {p.get('finished_at', 'N/A')}
    持續時間: {p.get('duration', 'N/A')}秒
    網址: {p.get('web_url', '')}"""
        except GitLabAPIError as e:
            return f"取得 Pipeline 失敗: {str(e)}"
  • The underlying GitLab API client method used by the MCP tool to retrieve pipeline information.
    def get_pipeline(self, project_id: int | str, pipeline_id: int) -> dict:
        """GET /projects/:id/pipelines/:pipeline_id"""
        pid = self._resolve_project_id(project_id)
        return self._get_json(f"/projects/{pid}/pipelines/{pipeline_id}")
Behavior2/5

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

No annotations are provided, so the description carries full burden for behavioral disclosure. It only states this retrieves information without mentioning authentication requirements, rate limits, error conditions, or what '詳細資訊' (detailed information) specifically includes. For a read operation with no annotation coverage, this leaves significant behavioral gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately brief with a clear purpose statement followed by parameter documentation. However, the parameter section uses minimal labels rather than full explanations, and the overall structure could be more front-loaded with critical information about when to use this tool.

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 has an output schema (which handles return values), 2 parameters with 0% schema coverage, and no annotations, the description is minimally complete but has significant gaps. It states the basic purpose but lacks usage guidance, parameter semantics, and behavioral context that would be needed for optimal agent understanding.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage, the description must compensate but provides minimal parameter context. It lists the two parameters with brief labels ('專案 ID 或路徑' - project ID or path, 'Pipeline ID') but doesn't explain format expectations, relationship between parameters, or what constitutes valid values. This doesn't adequately compensate for the schema coverage gap.

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 states '取得 Pipeline 詳細資訊' (Get pipeline detailed information), which provides a clear verb ('取得' - get) and resource ('Pipeline'). However, it doesn't distinguish this from sibling tools like 'list_pipelines' or 'get_project', making it somewhat vague about its specific scope beyond being a retrieval operation.

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 about when to use this tool versus alternatives. The description doesn't mention sibling tools like 'list_pipelines' (for listing multiple pipelines) or 'get_project' (for project-level information), nor does it specify prerequisites or appropriate contexts for retrieving detailed pipeline information.

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

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