Skip to main content
Glama

get_pipelines

Fetch CI/CD pipelines for a specific GitLab project, optionally filtered by status such as running, failed, or success.

Instructions

Get CI/CD pipelines for a GitLab project.

Args:
    project_id: GitLab project ID
    status: Pipeline status (running, pending, success, failed, canceled, skipped)
    token: GitLab Personal Access Token (optional)
    ctx: MCP context (automatically injected)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_idYes
statusNorunning
tokenNo
ctxNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The `get_pipelines` async function is the handler implementation decorated with @mcp.tool(). It takes a project_id, optional status filter (default 'running'), token, and ctx. It calls GitLab API endpoint /projects/{project_id}/pipelines?status={status}, formats up to 10 pipelines with ID, status, ref, and user name.
    async def get_pipelines(project_id: int, status: str = "running", token: str = None, ctx=None) -> str:
        """Get CI/CD pipelines for a GitLab project.
        
        Args:
            project_id: GitLab project ID
            status: Pipeline status (running, pending, success, failed, canceled, skipped)
            token: GitLab Personal Access Token (optional)
            ctx: MCP context (automatically injected)
        """
        endpoint = f"/projects/{project_id}/pipelines?status={status}"
        data = await make_gitlab_request(endpoint, ctx=ctx, token=token)
        
        if isinstance(data, dict) and "error" in data:
            return f"Error: {data['error']}"
        
        if not data:
            return f"No {status} pipelines found."
        
        pipelines = []
        for pipeline in data[:10]:  # Limit to 10 pipelines
            pipelines.append(f"Pipeline #{pipeline['id']}: {pipeline['status']} - {pipeline['ref']} ({pipeline.get('user', {}).get('name', 'Unknown')})")
        
        return "\n".join(pipelines)
  • The tool is registered via the @mcp.tool() decorator on line 195, which registers the Python function as an MCP tool named 'get_pipelines' in the FastMCP server instance.
    @mcp.tool()
    async def get_pipelines(project_id: int, status: str = "running", token: str = None, ctx=None) -> str:
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It indicates a read operation ('Get') but lacks details on pagination, error handling (e.g., invalid project_id), rate limiting, or authentication requirements beyond noting token is optional. The mention of 'ctx' as automatically injected is a technical detail but does not address behavioral traits.

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 extremely concise, using a docstring format with a single purpose sentence followed by parameter explanations. No wasted words, and the key information is front-loaded. Every sentence serves a purpose.

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 that an output schema exists, return values are not required in the description. However, the description does not mention potential limits (e.g., number of pipelines returned, pagination) or common filters beyond status. For a simple retrieval tool, this is adequate but not comprehensive.

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 0%, so the description compensates partially. It explains project_id as 'GitLab project ID', status with enumerated values, token as optional, and ctx as automatically injected. This adds meaning beyond the schema's bare type definitions, but could provide more context (e.g., token format, where to obtain it).

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

Purpose5/5

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

The description clearly states 'Get CI/CD pipelines for a GitLab project.' The verb 'Get' and resource 'CI/CD pipelines' are specific and unambiguous, distinguishing it from siblings like 'get_pipeline_jobs' and 'trigger_pipeline'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for retrieving pipelines given a project_id and optional status filter. However, it does not explicitly state when to use this tool versus alternatives, such as 'get_pipeline_jobs' for individual job details or 'trigger_pipeline' for creating runs. No exclusions are mentioned.

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/skmprb/gitlab-clone-mcp-server'

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