Skip to main content
Glama

gitlab_download_job_artifact

Retrieve metadata and download information for GitLab CI/CD job artifacts to access build outputs, test results, and reports without downloading files directly.

Instructions

Get information about job artifacts Returns: Artifact metadata and download information Use when: Checking build outputs, downloading test results, accessing reports Security: Returns artifact info only (no actual file download for security) Content: Lists available artifacts with sizes and expiration

Example response: { "job_id": 12345, "job_name": "build:production", "artifacts": [ {"filename": "dist.zip", "size": 1024000}, {"filename": "reports/junit.xml", "size": 5120} ], "artifacts_expire_at": "2023-02-01T00:00:00Z", "download_note": "Use GitLab web interface or CLI for actual downloads" }

Related tools:

  • gitlab_list_pipeline_jobs: Find job IDs with artifacts

  • gitlab_list_project_jobs: Browse all project jobs

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
job_idYesJob ID Type: integer Format: Numeric job identifier Example: 67890 How to find: From job URLs or gitlab_list_pipeline_jobs response
artifact_pathNoArtifact path Type: string Format: Path to specific artifact file within job artifacts Example: 'dist/bundle.js', 'reports/coverage.xml' Optional: If not specified, returns info about all artifacts

Implementation Reference

  • The core handler function for the 'gitlab_download_job_artifact' tool. It validates and extracts required parameters (project_id via detection or arg, job_id, optional artifact_path), then delegates execution to the GitLabClient's download_job_artifact method.
    def handle_download_job_artifact(client: GitLabClient, arguments: Optional[Dict[str, Any]]) -> Dict[str, Any]:
        """Handle downloading job artifacts"""
        project_id = require_project_id(client, arguments)
        job_id = require_argument(arguments, "job_id")
        artifact_path = get_argument(arguments, "artifact_path")
        
        return client.download_job_artifact(project_id, job_id, artifact_path)
  • Pydantic/MCP tool schema definition including input validation schema with required job_id (integer), optional project_id (string) and artifact_path (string). Used for tool registration and input validation.
        name=TOOL_DOWNLOAD_JOB_ARTIFACT,
        description=desc.DESC_DOWNLOAD_JOB_ARTIFACT,
        inputSchema={
            "type": "object",
            "properties": {
                "project_id": {"type": "string", "description": desc.DESC_PROJECT_ID},
                "job_id": {"type": "integer", "description": desc.DESC_JOB_ID},
                "artifact_path": {"type": "string", "description": desc.DESC_ARTIFACT_PATH}
            },
            "required": ["job_id"]
        }
    ),
  • Registration of the tool name to its handler function in the central TOOL_HANDLERS dictionary, which is used by server.py's call_tool() to dispatch tool calls.
    TOOL_DOWNLOAD_JOB_ARTIFACT: handle_download_job_artifact,
  • Duplicate/confirming entry in TOOL_HANDLERS mapping the tool name to handler (appears in multiple sections of the dict).
    TOOL_DOWNLOAD_JOB_ARTIFACT: handle_download_job_artifact,
  • Constant definition for the tool name string, used consistently across definitions, registrations, and handlers.
    TOOL_DOWNLOAD_JOB_ARTIFACT = "gitlab_download_job_artifact"
Behavior4/5

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

Since no annotations are provided, the description carries the full burden of behavioral disclosure. It effectively describes key behavioral traits: that it returns metadata only (not actual file downloads), mentions security implications, lists what content is returned (artifacts with sizes and expiration), and provides a detailed example response. The only minor gap is lack of explicit mention about whether this is a read-only operation.

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 well-structured and efficiently organized with clear sections (Returns, Use when, Security, Content, Example response, Related tools). Every sentence earns its place, providing essential information without redundancy. The information is front-loaded with the core purpose immediately stated.

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 tool with no annotations and no output schema, the description provides substantial context: clear purpose, usage guidelines, behavioral details, security notes, example response, and related tools. The main gap is the lack of explicit output schema documentation, though the example response partially compensates. Given the complexity and lack of structured fields, this is quite 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?

With 100% schema description coverage, the schema already comprehensively documents all three parameters. The description doesn't add any parameter-specific information beyond what's in the schema descriptions, so it meets the baseline expectation without providing additional value.

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 tool's purpose with specific verbs ('Get information about job artifacts') and distinguishes it from actual file downloads. It explicitly mentions what it returns ('Artifact metadata and download information') and differentiates from sibling tools like gitlab_list_pipeline_jobs by focusing on artifact details rather than job listing.

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 usage guidance with a 'Use when:' section listing specific scenarios (checking build outputs, downloading test results, accessing reports). It also references related tools for finding job IDs and browsing jobs, clearly establishing when to use this tool versus alternatives.

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