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"

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