Add artifacts facet to get_job and get_pipeline MCP tools

Summary

Adds an include: artifacts facet to the get_job and get_pipeline MCP tools, so agents can list CI/CD job artifacts without a separate tool. This is the first of two stacked MRs implementing #585022 (closed) (MCP Tool request - CI/CD Artifacts); a tool proposal was posted on that issue and reviewed by @terrichu (backend) and @amandarueda (product), and their feedback is incorporated below. The issue itself closes with the follow-up MR that adds get_artifact_file.

get_job: artifacts facet

Lists the artifacts a job produced: id, name, size, file_type, expire_at, expired. Backed by a direct model read (job.job_artifacts), since get_job is a CustomService that already reads the model directly. No pagination is needed: a job stores at most one artifact per file type, so the list is bounded to roughly 25 entries.

get_pipeline: artifacts facet

Returns a flat list of artifacts across all jobs in the pipeline. Each entry additionally carries job_id and job_name, so a follow-up call can target the producing job. This is backed by the existing GraphQL Pipeline.jobs connection with nested artifacts, not by Pipeline.jobArtifacts — that field is an unpaginated plain list, and its CiJobArtifact type carries no job reference, so it can't deliver cursor pagination or job provenance. As a result, pagination pages over the pipeline's jobs rather than over artifacts directly; this is documented in the tool description, the parameter docs, and the user docs.

Other changes

  • Both tool descriptions now mention "artifacts" explicitly, per @amandarueda's feedback that agents discover capability by name.
  • file_type values are downcased in output (the GraphQL enum is uppercase) to match the casing already used by the get_job facet's model values.
  • Docs updated in doc/user/model_context_protocol/mcp_server_tools.md for both tools, with history entries noting the artifacts facet was introduced in GitLab 19.5 and linking the issue.

Specs

Schema locks updated. Added facet examples for both tools: flat-list shape with job provenance, empty list for a job without artifacts, pagination-over-jobs on a dedicated pipeline, and the existing get_job "hides whether the job exists" probe loop extended to cover the artifacts facet.

How I verified

Full manual pass in MCP Inspector (MCP Jam → mcp-remote → nginx at gdk.test:3443) on a seeded job with an artifacts archive:

get_job with include: ["artifacts"] get_pipeline with include: ["artifacts"]
mcpjam_get_job_artifacts_facet mcpjam_get_pipeline_artifacts_facet

Both facets return names, sizes, and types only; the pipeline facet rows additionally carry job_id/job_name provenance and cursor page_info.

Also ran a JSON-RPC tools/list + tools/call round trip against GDK:

  • get_job's include enum is now [log, artifacts]; get_pipeline's is [jobs, downstream_pipelines, bridge_jobs, artifacts].
  • get_job's artifacts facet returned archive and metadata artifacts with correct sizes.
  • get_pipeline's artifacts facet returned artifacts across 3 jobs, including a junit report artifact, with correct cursor page_info.

Related to #585022 (closed)

Edited by Tian Gao

Merge request reports

Loading
Loading