Skip to main content
Glama

gitlab_list_project_jobs

Monitor CI/CD pipelines by retrieving all jobs for a GitLab project with filtering by status and pagination support.

Instructions

List all jobs for a project Returns: Array of jobs across all pipelines with filtering options Use when: Monitoring project CI/CD, finding recent failures, browsing job history Pagination: Yes (default 20 per page) Filtering: By job status/scope (failed, success, running, etc.)

Example response: [{ "id": 67890, "name": "deploy:staging", "stage": "deploy", "status": "failed", "pipeline": {"id": 123, "ref": "main"}, "commit": {"short_id": "abc1234"}, "created_at": "2023-01-01T15:30:00Z", "user": {"name": "Jane Doe"} }]

Related tools:

  • gitlab_list_pipeline_jobs: Jobs for specific pipeline

  • gitlab_list_pipelines: Find pipeline information

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_idNoProject identifier (auto-detected if not provided) Type: integer OR string Format: numeric ID or 'namespace/project' Optional: Yes - auto-detects from current git repository Examples: - 12345 (numeric ID) - 'gitlab-org/gitlab' (namespace/project path) - 'my-group/my-subgroup/my-project' (nested groups) Note: If in a git repo with GitLab remote, this can be omitted
scopeNoJob scope filter Type: string Format: Filter jobs by status Options: 'created' | 'pending' | 'running' | 'failed' | 'success' | 'canceled' | 'skipped' | 'waiting_for_resource' | 'manual' Examples: - 'failed' (only failed jobs) - 'success' (only successful jobs) - 'running' (currently running jobs)
per_pageNoNumber of results per page Type: integer Range: 1-100 Default: 20 Example: 50 (for faster browsing) Tip: Use smaller values (10-20) for detailed operations, larger (50-100) for listing
pageNoPage number for pagination Type: integer Range: ≥1 Default: 1 Example: 3 (to get the third page of results) Note: Use with per_page to navigate large result sets

Implementation Reference

  • The main handler function that executes the gitlab_list_project_jobs tool. It resolves the project ID, extracts parameters like scope, pagination, and calls the GitLabClient's list_project_jobs method.
    def handle_list_project_jobs(client: GitLabClient, arguments: Optional[Dict[str, Any]]) -> Dict[str, Any]:
        """Handle listing jobs for a project"""
        project_id = require_project_id(client, arguments)
        scope = get_argument(arguments, "scope")
        per_page = get_argument(arguments, "per_page", DEFAULT_PAGE_SIZE)
        page = get_argument(arguments, "page", 1)
        
        return client.list_project_jobs(project_id, scope=scope, per_page=per_page, page=page)
  • Registration of the handler function in the TOOL_HANDLERS dictionary, which is used by the server to dispatch tool calls to the appropriate handler.
    TOOL_LIST_PROJECT_JOBS: handle_list_project_jobs,
  • Pydantic/MCP schema definition for the gitlab_list_project_jobs tool, including input parameters like project_id, scope, and pagination.
    types.Tool(
        name=TOOL_LIST_PROJECT_JOBS,
        description=desc.DESC_LIST_PROJECT_JOBS,
        inputSchema={
            "type": "object",
            "properties": {
                "project_id": {"type": "string", "description": desc.DESC_PROJECT_ID},
                "scope": {"type": "string", "description": desc.DESC_JOB_SCOPE, "enum": ["created", "pending", "running", "failed", "success", "canceled", "skipped", "waiting_for_resource", "manual"]},
                "per_page": {"type": "integer", "description": desc.DESC_PER_PAGE, "default": DEFAULT_PAGE_SIZE, "minimum": 1, "maximum": MAX_PAGE_SIZE},
                "page": {"type": "integer", "description": desc.DESC_PAGE_NUMBER, "default": 1, "minimum": 1}
            }
        }
    ),
  • Tool registration in the server's list_tools() method, which exposes the schema to MCP clients.
    types.Tool(
        name=TOOL_LIST_PROJECT_JOBS,
        description=desc.DESC_LIST_PROJECT_JOBS,
        inputSchema={
            "type": "object",
            "properties": {
                "project_id": {"type": "string", "description": desc.DESC_PROJECT_ID},
                "scope": {"type": "string", "description": desc.DESC_JOB_SCOPE, "enum": ["created", "pending", "running", "failed", "success", "canceled", "skipped", "waiting_for_resource", "manual"]},
                "per_page": {"type": "integer", "description": desc.DESC_PER_PAGE, "default": DEFAULT_PAGE_SIZE, "minimum": 1, "maximum": MAX_PAGE_SIZE},
                "page": {"type": "integer", "description": desc.DESC_PAGE_NUMBER, "default": 1, "minimum": 1}
            }
        }
    ),
  • Helper function used by the handler to resolve or detect the project_id, raising an error if not available.
    def require_project_id(client: GitLabClient, arguments: Optional[Dict[str, Any]]) -> str:
        """Get project_id or raise error if not found"""
        project_id = get_project_id_or_detect(client, arguments)
        if not project_id:
            raise ValueError(ERROR_NO_PROJECT)
        return project_id
Behavior4/5

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

With no annotations provided, the description carries full burden and does well by disclosing key behavioral traits: it specifies the return format ('Array of jobs'), mentions pagination behavior ('Yes (default 20 per page)'), describes filtering capabilities ('By job status/scope'), and provides a detailed example response showing structure. It doesn't mention authentication requirements or rate limits, but covers most operational aspects.

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 well-structured with clear sections (purpose, returns, use when, pagination, filtering, example, related tools) and every sentence earns its place. It could be slightly more concise by integrating some information, but overall it's efficiently organized and front-loaded with key information.

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

Completeness4/5

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

For a read-only listing tool with 4 parameters and no output schema, the description provides excellent context: clear purpose, usage guidelines, behavioral details (pagination, filtering), example response, and sibling tool differentiation. The main gap is no authentication or rate limit information, but otherwise it's quite complete for this tool type.

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 fully documents all 4 parameters. The description adds minimal parameter semantics beyond what's in the schema - it mentions filtering options generally but doesn't provide additional syntax or format details. This meets the baseline of 3 when schema does the heavy lifting.

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 the verb 'List' and resource 'all jobs for a project', specifying it returns an array of jobs across all pipelines with filtering options. It explicitly distinguishes from sibling tools by mentioning 'gitlab_list_pipeline_jobs: Jobs for specific pipeline' and 'gitlab_list_pipelines: Find pipeline information', showing clear differentiation.

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

Usage Guidelines5/5

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

The description provides explicit 'Use when' guidance: 'Monitoring project CI/CD, finding recent failures, browsing job history'. It also names specific alternative tools for different use cases in the 'Related tools' section, giving clear when-to-use and when-not-to-use context.

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

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