Skip to main content
Glama

gitlab_download_job_artifact

Retrieve metadata and download details for job artifacts from GitLab CI/CD pipelines. Use to check build outputs, access reports, or verify artifact sizes and expiration dates.

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
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
job_idYesJob ID Type: integer Format: Numeric job identifier Example: 67890 How to find: From job URLs or gitlab_list_pipeline_jobs response
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

Implementation Reference

  • The core handler function for the gitlab_download_job_artifact tool. It resolves the project ID (from args or git detection), requires job_id, optionally takes artifact_path, and delegates to GitLabClient.download_job_artifact() to perform the actual download operation.
    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)
  • MCP tool schema definition specifying the input parameters: job_id (required integer), project_id (string, auto-detected if missing), artifact_path (optional string).
    types.Tool( 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 handler in the TOOL_HANDLERS dictionary mapping tool name to its handler function. (Note: appears twice in the dict for different sections)
    TOOL_DOWNLOAD_JOB_ARTIFACT: handle_download_job_artifact,
  • Constant definition for the tool name string used across modules for consistency.
    TOOL_DOWNLOAD_JOB_ARTIFACT = "gitlab_download_job_artifact"

Other Tools

Related 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